trabajando tabla tiradas para el editor

This commit is contained in:
Jaime Jiménez
2023-08-11 09:52:12 +02:00
parent 0c3485681c
commit 3b84839fc0
6 changed files with 78 additions and 52 deletions

View File

@ -46,7 +46,6 @@
<table id="tableOfTarifaencuadernaciontiradas" class="table table-striped table-hover" style="width: 100%;">
<thead>
<tr>
<th><?= lang('TarifaEncuadernacionTiradas.seleccion') ?></th>
<th><?= lang('TarifaEncuadernacionTiradas.proveedor') ?></th>
<th><?= lang('TarifaEncuadernacionTiradas.tiradaMin') ?></th>
<th><?= lang('TarifaEncuadernacionTiradas.tiradaMax') ?></th>
@ -339,7 +338,8 @@
table : "#tableOfTarifaencuadernaciontiradas",
idSrc: 'id',
fields: [ {
name: "proveedor"
name: "proveedor",
"type": "select"
}, {
name: "tirada_min"
}, {
@ -348,6 +348,9 @@
"name": "tarifa_encuadernacion_id",
"type": "hidden"
},{
name: "proveedor_id",
"type": "hidden"
}, {
"name": "deleted_at",
"type": "hidden"
},{
@ -382,6 +385,7 @@
theTable.draw();
});
var theTable2 = $('#tableOfTarifaencuadernaciontiradas').DataTable( {
serverSide: true,
processing: true,
@ -393,6 +397,7 @@
lengthChange: true,
searching: false,
paging: true,
select: true,
info: false,
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
ajax : $.fn.dataTable.pipeline( {
@ -405,9 +410,6 @@
async: true,
}),
columns: [
{
className: 'dt-body-center'
},
{ 'data': 'proveedor' },
{ 'data': 'tirada_min' },
{ 'data': 'tirada_max' },
@ -421,15 +423,8 @@
orderable: false,
searchable: false,
targets: [lastColNr2]
},
{
orderable: false,
className: 'select-checkbox',
targets: 0
}
//],
// {"orderData": [ 0, 1 ], "targets": 0 },
},
{"orderData": [ 0, 1 ], "targets": 1 },
],
language: {
@ -443,18 +438,14 @@
submitTrigger: -1,
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
}
} ],
select: {
style: 'single',
selector: 'td:first-child'
}
} ]
} );
// Activate an inline edit on click of a table cell
$('#tableOfTarifaencuadernaciontiradas').on( 'click', 'tbody span.edit', function (e) {
editor.inline(
theTable.cells(this.parentNode.parentNode, '*').nodes(),
editor2.inline(
theTable2.cells(this.parentNode.parentNode, '*').nodes(),
{
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
cancelTrigger: 'span.cancel',
@ -502,8 +493,10 @@
<?php endif; ?>
<?=$this->section('css') ?>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.2.3/css/buttons.bootstrap5.min.css">
<?=$this->endSection() ?>
@ -516,6 +509,6 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js" integrity="sha512-xcHCGC5tQ0SHlRX8Anbz6oy/OullASJkEhb4gjkneVpGE3/QGYejf14CUO5n5q5paiHfRFTa9HKgByxzidw2Bw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/pdfmake.min.js" integrity="sha512-rDbVu5s98lzXZsmJoMa0DjHNE+RwPJACogUCLyq3Xxm2kJO6qsQwjbE5NDk2DqmlKcxDirCnU1wAzVLe12IM3w==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.5/vfs_fonts.js" integrity="sha512-cktKDgjEiIkPVHYbn8bh/FEyYxmt4JDJJjOCu5/FQAkW4bc911XtKYValiyzBiJigjVEvrIAyQFEbRJZyDA1wQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.js') ?>"></script>
<?=$this->endSection() ?>