mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
haciendo select en tabla tiradas encuadernacion
This commit is contained in:
@ -378,6 +378,11 @@ $routes->group('tarifaencuadernacionlineas', ['namespace' => 'App\Controllers\Ta
|
||||
});
|
||||
$routes->resource('tarifaencuadernacionlineas', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifaencuadernacionlineas', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('tarifaencuadernaciontiradas', ['namespace' => 'App\Controllers\Tarifas'], function ($routes) {
|
||||
$routes->post('datatable', 'Tarifaencuadernaciontiradas::datatable', ['as' => 'dataTableOfTarifaEncuadernacionTiradas']);
|
||||
$routes->post('datatable_editor', 'Tarifaencuadernaciontiradas::datatable_editor', ['as' => 'editorOfTarifaEncuadernacionTiradas']);
|
||||
});
|
||||
$routes->resource('tarifaencuadernaciontiradas', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifaencuadernaciontiradas', 'except' => 'show,new,create,update']);
|
||||
|
||||
$routes->group('proveedores', ['namespace' => 'App\Controllers\Compras'], function ($routes) {
|
||||
$routes->get('', 'Proveedores::index', ['as' => 'proveedorList']);
|
||||
|
||||
@ -322,14 +322,14 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
||||
$order = TarifaEncuadernacionLineaModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 0];
|
||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
$id_TM = $reqData['id_tarifaencuadernacion'] ?? -1;
|
||||
$id_TE = $reqData['tirada_id'] ?? -1;
|
||||
|
||||
$resourceData = $this->model->getResource("", $id_TM)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
$resourceData = $this->model->getResource("", $id_TE)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource()->countAllResults(),
|
||||
$this->model->getResource($search, $id_TM)->countAllResults()
|
||||
$this->model->getResource("", $id_TE)->countAllResults()
|
||||
));
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
|
||||
@ -23,7 +23,9 @@ use
|
||||
|
||||
class Tarifaencuadernaciontiradas extends \App\Controllers\GoBaseResourceController
|
||||
{
|
||||
public function datatable_editor()
|
||||
protected static $controllerSlug = 'tarifaencuadernaciontiradas';
|
||||
|
||||
public function datatable_editor()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
@ -131,6 +133,7 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\GoBaseResourceControl
|
||||
public function datatable()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$reqData = $this->request->getPost();
|
||||
if (!isset($reqData['draw']) || !isset($reqData['columns'])) {
|
||||
$errstr = 'No data available in response to this specific request.';
|
||||
@ -141,17 +144,19 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\GoBaseResourceControl
|
||||
$length = $reqData['length'] ?? 5;
|
||||
$search = $reqData['search']['value'];
|
||||
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
|
||||
$order = TarifaEncuadernacionLineaModel::SORTABLE[$requestedOrder >= 0 ? $requestedOrder : 0];
|
||||
$order = TarifaEncuadernacionTiradaModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
|
||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
$id_TM = $reqData['id_tarifaencuadernacion'] ?? -1;
|
||||
|
||||
$resourceData = $this->model->getResource("", $id_TM)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
$model = new TarifaEncuadernacionTiradaModel();
|
||||
|
||||
$resourceData = $model->getResource("", $id_TM)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource()->countAllResults(),
|
||||
$this->model->getResource($search, $id_TM)->countAllResults()
|
||||
$model->getResource()->countAllResults(),
|
||||
$model->getResource($search, $id_TM)->countAllResults()
|
||||
));
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace App\Models\Tarifas;
|
||||
|
||||
class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
|
||||
class TarifaEncuadernacionTiradaModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "tarifa_encuadernacion_tiradas";
|
||||
|
||||
|
||||
@ -551,11 +551,7 @@
|
||||
|
||||
<?=$this->section('css') ?>
|
||||
|
||||
<?php /*
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/ccs/datatables-editor/editor.dataTables.min.css') ?>">
|
||||
-*/ ?>
|
||||
<link rel="stylesheet" href="https://editor.datatables.net/extensions/Editor/css/editor.dataTables.min.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">
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||
|
||||
<?= $this->section("content") ?>
|
||||
@ -29,84 +30,78 @@
|
||||
</div><!--//.col -->
|
||||
|
||||
|
||||
<?php if($formAction == site_url('tarifas/tarifasencuadernacion/add')): ?>
|
||||
<div class="accordion mt-3" id="accordionEncuadernacionTiradas" style="visibility:hidden" >
|
||||
<?php else: ?>
|
||||
<?php if(str_contains($formAction, 'edit')): ?>
|
||||
<div class="accordion mt-3" id="accordionEncuadernacionTiradas" style="visibility:visible" >
|
||||
<?php endif; ?>
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip2" aria-expanded="false" aria-controls="accordionTip2">
|
||||
<h3><?= lang("TarifaEncuadernacionTiradas.moduleTitle") ?></h3>
|
||||
</button>
|
||||
|
||||
</h2>
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip2" aria-expanded="false" aria-controls="accordionTip2">
|
||||
<h3><?= lang("TarifaEncuadernacionTiradas.moduleTitle") ?></h3>
|
||||
</button>
|
||||
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip2" class="accordion-collapse collapse show" data-bs-parent="#accordionEncuadernacionTiradas">
|
||||
<div class="accordion-body">
|
||||
|
||||
<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>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
<div id="accordionTip2" class="accordion-collapse collapse show" data-bs-parent="#accordionEncuadernacionTiradas">
|
||||
<div class="accordion-body">
|
||||
|
||||
<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>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
|
||||
|
||||
<?php if($formAction == site_url('tarifas/tarifasencuadernacion/add')): ?>
|
||||
<div class="accordion mt-3" id="accordionEncuadernacionLineas" style="visibility:hidden" >
|
||||
<?php else: ?>
|
||||
<div class="accordion mt-3" id="accordionEncuadernacionLineas" style="visibility:visible" >
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||
<h3><?= lang("TarifaEncuadernacionLineas.moduleTitle") ?></h3>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionEncuadernacionLineas">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableOfTarifaencuadernacionlineas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.margen') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
<?php endif; ?>
|
||||
<div class="card accordion-item active">
|
||||
<h2 class="accordion-header" id="headingOne">
|
||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||
<h3><?= lang("TarifaEncuadernacionLineas.moduleTitle") ?></h3>
|
||||
</button>
|
||||
|
||||
</h2>
|
||||
|
||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionEncuadernacionLineas">
|
||||
<div class="accordion-body">
|
||||
|
||||
<table id="tableOfTarifaencuadernacionlineas" class="table table-striped table-hover" style="width: 100%;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.paginasMax') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.precioMin') ?></th>
|
||||
<th><?= lang('TarifaEncuadernacionLineas.margen') ?></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- //.accordion -->
|
||||
</div><!--//.row -->
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para general -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
const lastColNr = $('#tableOfTarifaencuadernacionlineas').find("tr:first th").length - 1;
|
||||
const url = window.location.href;
|
||||
const url_parts = url.split('/');
|
||||
var id = -1;
|
||||
if(url_parts[url_parts.length-2] == 'edit'){
|
||||
id = url_parts[url_parts.length-1];
|
||||
}
|
||||
@ -114,16 +109,30 @@
|
||||
id = -1;
|
||||
}
|
||||
|
||||
<?php if(str_contains($formAction, 'edit')): ?>
|
||||
const actionBtns = function(data) {
|
||||
return `
|
||||
<span class="edit"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></span>
|
||||
<span class="cancel"></span>
|
||||
<span class="remove"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i></span>
|
||||
`;
|
||||
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
||||
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||
<span class="cancel"></span>
|
||||
`;
|
||||
};
|
||||
|
||||
var selected_tirada_id = -1;
|
||||
<?php endif; ?>
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
editor = new $.fn.dataTable.Editor( {
|
||||
|
||||
<?php if(str_contains($formAction, 'edit')): ?>
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para tableOfTarifaencuadernacionlineas -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
const lastColNr = $('#tableOfTarifaencuadernacionlineas').find("tr:first th").length - 1;
|
||||
|
||||
var editor = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfTarifaEncuadernacionLineas') ?>",
|
||||
headers: {
|
||||
@ -155,6 +164,7 @@
|
||||
]
|
||||
} );
|
||||
|
||||
|
||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['tirada_encuadernacion_id'] = id;
|
||||
@ -172,14 +182,14 @@
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
|
||||
editor.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.draw();
|
||||
});
|
||||
|
||||
|
||||
var theTable = $('#tableOfTarifaencuadernacionlineas').DataTable( {
|
||||
var theTable = $('#tableOfTarifaencuadernacionlineas').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
@ -195,7 +205,7 @@
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfTarifaEncuadernacionLineas') ?>',
|
||||
data: {
|
||||
id_tarifaencuadernacion: id,
|
||||
tirada_id: selected_tirada_id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
@ -230,21 +240,20 @@
|
||||
editor: editor,
|
||||
formOptions: {
|
||||
submitTrigger: -1,
|
||||
submitHtml: '<i class="ti ti-device-floppy"/>'
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||
}
|
||||
} ]
|
||||
} );
|
||||
|
||||
|
||||
|
||||
// Activate an inline edit on click of a table cell
|
||||
$('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.edit', function (e) {
|
||||
editor.inline(
|
||||
theTable.cells(this.parentNode.parentNode, '*').nodes(),
|
||||
{
|
||||
cancelHtml: '<i class="ti ti-x"></i>',
|
||||
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||
cancelTrigger: 'span.cancel',
|
||||
submitHtml: '<i class="ti ti-device-floppy"></i>',
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||
submitTrigger: 'span.edit',
|
||||
submit: 'allIfChanged'
|
||||
}
|
||||
@ -253,6 +262,36 @@
|
||||
|
||||
|
||||
// Delete row
|
||||
$(document).on('click', '.btn-delete', function(e) {
|
||||
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||
});
|
||||
|
||||
$(document).on('click', '.btn-remove', function(e) {
|
||||
const dataId = $(this).attr('data-id');
|
||||
const row = $(this).closest('tr');
|
||||
if ($.isNumeric(dataId)) {
|
||||
/*$.ajax({
|
||||
url: `/configuracion/papelimpresiontipologias/delete/${dataId}`,
|
||||
method: 'GET',
|
||||
}).done((data, textStatus, jqXHR) => {
|
||||
$('#confirm2delete').modal('toggle');
|
||||
theTable.clearPipeline();
|
||||
theTable.row($(row)).invalidate().draw();
|
||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||
})*/
|
||||
console.log(this.parentNode);
|
||||
/*editor
|
||||
.create( false )
|
||||
.edit( this.parentNode, false)
|
||||
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
|
||||
.set( 'is_deleted', 1 )
|
||||
.submit();*/
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
$('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.remove', function (e) {
|
||||
|
||||
Swal.fire({
|
||||
@ -278,10 +317,192 @@
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
});*/
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<!------------------------------------------->
|
||||
<!-- Código JS para tableOfTarifaencuadernaciontiradas -->
|
||||
<!------------------------------------------->
|
||||
<?= $this->section("additionalInlineJs") ?>
|
||||
|
||||
const lastColNr2 = $('#tableOfTarifaencuadernaciontiradas').find("tr:first th").length - 1;
|
||||
|
||||
var editor2 = new $.fn.dataTable.Editor( {
|
||||
ajax: {
|
||||
url: "<?= route_to('editorOfTarifaEncuadernacionTiradas') ?>",
|
||||
headers: {
|
||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||
},
|
||||
},
|
||||
table : "#tableOfTarifaencuadernaciontiradas",
|
||||
idSrc: 'id',
|
||||
fields: [ {
|
||||
name: "proveedor"
|
||||
}, {
|
||||
name: "tirada_min"
|
||||
}, {
|
||||
name: "tirada_max"
|
||||
}, {
|
||||
"name": "tarifa_encuadernacion_id",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "deleted_at",
|
||||
"type": "hidden"
|
||||
},{
|
||||
"name": "is_deleted",
|
||||
"type": "hidden"
|
||||
},
|
||||
]
|
||||
} );
|
||||
|
||||
|
||||
editor2.on( 'preSubmit', function ( e, d, type ) {
|
||||
if ( type === 'create'){
|
||||
d.data[0]['tarifa_encuadernacion_id'] = id;
|
||||
}
|
||||
else if(type === 'edit' ) {
|
||||
for (v in d.data){
|
||||
d.data[v]['tarifa_encuadernacion_id'] = id;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
editor2.on( 'postSubmit', function ( e, json, data, action ) {
|
||||
|
||||
yeniden(json.<?= csrf_token() ?>);
|
||||
});
|
||||
|
||||
|
||||
editor2.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||
|
||||
theTable.clearPipeline();
|
||||
theTable.draw();
|
||||
});
|
||||
|
||||
var theTable2 = $('#tableOfTarifaencuadernaciontiradas').DataTable( {
|
||||
serverSide: true,
|
||||
processing: true,
|
||||
autoWidth: true,
|
||||
responsive: true,
|
||||
lengthMenu: [ 5, 10, 25],
|
||||
order: [ 0, "asc" ],
|
||||
pageLength: 10,
|
||||
lengthChange: true,
|
||||
searching: false,
|
||||
paging: true,
|
||||
info: false,
|
||||
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||
ajax : $.fn.dataTable.pipeline( {
|
||||
url: '<?= route_to('dataTableOfTarifaEncuadernacionTiradas') ?>',
|
||||
data: {
|
||||
id_tarifaencuadernacion: id,
|
||||
},
|
||||
method: 'POST',
|
||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||
async: true,
|
||||
}),
|
||||
columns: [
|
||||
{
|
||||
className: 'dt-body-center'
|
||||
},
|
||||
{ 'data': 'proveedor' },
|
||||
{ 'data': 'tirada_min' },
|
||||
{ 'data': 'tirada_max' },
|
||||
{
|
||||
data: actionBtns,
|
||||
className: 'row-edit dt-center'
|
||||
}
|
||||
],
|
||||
columnDefs: [
|
||||
{
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
targets: [lastColNr2]
|
||||
},
|
||||
{
|
||||
orderable: false,
|
||||
className: 'select-checkbox',
|
||||
targets: 0
|
||||
}
|
||||
//],
|
||||
|
||||
// {"orderData": [ 0, 1 ], "targets": 0 },
|
||||
|
||||
],
|
||||
language: {
|
||||
url: "//cdn.datatables.net/plug-ins/1.13.4/i18n/<?= config('Basics')->i18n ?>.json"
|
||||
},
|
||||
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>'
|
||||
}
|
||||
} ],
|
||||
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(),
|
||||
{
|
||||
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||
cancelTrigger: 'span.cancel',
|
||||
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||
submitTrigger: 'span.edit',
|
||||
submit: 'allIfChanged'
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
|
||||
// Delete row
|
||||
|
||||
/*
|
||||
$('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.remove', function (e) {
|
||||
|
||||
Swal.fire({
|
||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
|
||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
||||
cancelButtonColor: '#d33'
|
||||
})
|
||||
.then((result) => {
|
||||
const dataId = $(this).data('id');
|
||||
const row = $(this).closest('tr');
|
||||
if (result.value) {
|
||||
editor
|
||||
.create( false )
|
||||
.edit( this.parentNode, false)
|
||||
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
|
||||
.set( 'is_deleted', 1 )
|
||||
.submit();
|
||||
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
<?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() ?>
|
||||
|
||||
@ -289,6 +510,7 @@
|
||||
<?= $this->section('additionalExternalJs') ?>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.bootstrap5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/select/1.7.0/js/dataTables.select.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.2.3/js/buttons.print.min.js"></script>
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user