Resuelto el problema del add filtrando crear el datatable cuando es un edit solamente

This commit is contained in:
Jaime Jiménez
2023-07-16 23:10:45 +02:00
parent d9032837e3
commit 7b1928728d
3 changed files with 55 additions and 48 deletions

View File

@ -14,9 +14,15 @@ class PapelImpresionModel extends \App\Models\GoBaseModel
const SORTABLE = [
0 => "t1.nombre",
1 => "t1.papel_generico_id",
2 => "t1.gramaje",
3 => "t2.nombre",
1 => "t2.nombre",
2 => "t1.bn",
3 => "t1.gramaje",
4 => "t1.color",
5 => "t1.cubierta",
6 => "t1.sobrecubierta",
7 => "t1.rotativa",
8 => "t1.isActivo",
/*1 => "t1.id",
2 => "t1.papel_generico_id",

View File

@ -26,8 +26,8 @@
</form>
</div><!-- //.card -->
<?php if(str_contains($formAction,'edit')): ?>
<?php if($papelImpresion->rotativa == true): ?>
<?php if(str_contains($formAction,'edit') && $papelImpresion->rotativa == true): ?>
<div class="accordion mt-3" id="accordionTipologias">
<?php else: ?>
<div class="accordion mt-3" id="accordionTipologias" style="display:none">
@ -64,8 +64,6 @@
</div>
</div>
</div> <!-- //.accordion -->
<?php endif; ?>
<div class="accordion mt-3" id="accordionMaquinas">
@ -214,6 +212,9 @@
</div>`;
};
if(url_parts[url_parts.length-2] == 'edit'){
theTable = $('#tableOfPapelimpresiontipologias').DataTable({
processing: true,
serverSide: true,
@ -253,7 +254,7 @@
});
}
// Add new tipología
$('#newTipologia').on("click", function(e) {
if ($('#tableOfPapelimpresiontipologias').DataTable().data().count() >= 3){

View File

@ -89,7 +89,7 @@
{
orderable: false,
searchable: false,
targets: [3, 4, 5, 6, 7, lastColNr] //JJO añadidas bool cols
targets: [lastColNr] //JJO añadidas bool cols
}
],
columns : [