From ed993deb12a7e861bd5257f3c93567b457da200e Mon Sep 17 00:00:00 2001 From: imnavajas Date: Fri, 23 Feb 2024 13:58:57 +0100 Subject: [PATCH] Incluido select en buscador --- .../buscador/viewBuscadorList.php | 21 ++++++++++++++++++- .../viewCosidotapablandaList.php | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/buscador/viewBuscadorList.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/buscador/viewBuscadorList.php index 59941590..43f17ce7 100644 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/buscador/viewBuscadorList.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/buscador/viewBuscadorList.php @@ -110,6 +110,25 @@ $('#tableOfPresupuestos thead tr:eq(1) th').each(function (i) { }); } + else if (i == 2) { + // Agregar un selector en la tercera columna + $(this).html(''); + + // Agregar opciones al selector + var selector = $('select', this); + selector.append(''); // Opción vacía + // Agregar más opciones según tus necesidades + selector.append(''); + selector.append(''); + + selector.on('change', function () { + var val = $.fn.dataTable.util.escapeRegex( + $(this).val() + ); + console.log(val) + theTable.column(i).search(val ? '^' + val + '$' : '', true, false).draw(); + }); + } else{ $(this).html(''); @@ -140,7 +159,7 @@ theTable = $('#tableOfPresupuestos').DataTable({ lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ], pageLength: 50, lengthChange: true, - "dom": 'lBrtip', + "dom": '<"mb-3"l>Brtip', "buttons": [ 'colvis', 'copy', 'csv', 'excel', 'print', { extend: 'pdfHtml5', diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaList.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaList.php index dc27270e..743bdd47 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaList.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/viewCosidotapablandaList.php @@ -140,7 +140,7 @@ theTable = $('#tableOfPresupuestos').DataTable({ lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ], pageLength: 50, lengthChange: true, - "dom": 'lBrtip', + "dom": '<"mb-3"l>Brtip', "buttons": [ 'colvis', 'copy', 'csv', 'excel', 'print', { extend: 'pdfHtml5',