Encontrado como hacerlo

This commit is contained in:
imnavajas
2023-09-05 15:28:53 +02:00
parent 5b4126f460
commit 1cce675f79

View File

@ -18,10 +18,10 @@
</div><!-- /.card-body -->
<div class="pt-4">
<input type="submit"
class="btn btn-primary float-start me-sm-3 me-1"
name="save"
value="<?= lang("Basic.global.Save") ?>"
/>
class="btn btn-primary float-start me-sm-3 me-1"
name="save"
value="<?= lang("Basic.global.Save") ?>"
/>
<?= anchor(route_to("tarifaEnvioList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
</div><!-- /.card-footer -->
@ -72,7 +72,7 @@
<div id="accordionTip2" class="accordion-collapse collapse show" data-bs-parent="#accordionPrecios">
<div class="accordion-body">
<div id="newButton" class="mb-4 float-end"></div>
<table id="tableOfPrecios" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
@ -423,11 +423,11 @@ const lastColNr2 = $('#tableOfPrecios').find("tr:first th").length - 1;
order: [ 0, "asc" ],
pageLength: 25,
lengthChange: true,
searching: false,
searching: true,
paging: true,
info: false,
//dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
"dom": 'lfBrtip',
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
//dom: 'lBfrtip',
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfTarifasEnvioPrecios') ?>',
data: function ( d ) {
@ -471,40 +471,41 @@ const lastColNr2 = $('#tableOfPrecios').find("tr:first th").length - 1;
],
language: {
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json",
},
/*buttons: [
'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
},
],*/
} );
buttons: [ 'copy', 'csv', 'excel', 'print', {
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'A4'
}],
new $.fn.dataTable.Buttons( theTable2, {
initComplete: function () {
name: 'new',
className: 'btn btn-primary float-end me-sm-3 me-1',
extend: "createInline",
editor: editor2,
formOptions: {
submitTrigger: -1,
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
new $.fn.dataTable.Buttons(theTable2, {
name: 'test2',
buttons: [{
className: 'btn btn-primary float-end me-sm-3 me-1',
extend: "createInline",
editor: editor2,
formOptions: {
submitTrigger: -1,
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
},
}
}]
});
theTable2.buttons('test2', null)
.container()
.insertBefore('.dataTables_length');
}
} );
theTable2.buttons( 'new', null ).container().appendTo(
//theTable2.table().container()
'#panel'
);
// Activate an inline edit on click of a table cell
$('#tableOfPrecios').on( 'click', 'tbody span.edit', function (e) {
editor2.inline(