mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Incluido select en buscador
This commit is contained in:
@ -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('<select class="form-control" style="min-width:100px;max-width:120px;font-size:0.8rem !important;"></select>');
|
||||||
|
|
||||||
|
// Agregar opciones al selector
|
||||||
|
var selector = $('select', this);
|
||||||
|
selector.append('<option value=""></option>'); // Opción vacía
|
||||||
|
// Agregar más opciones según tus necesidades
|
||||||
|
selector.append('<option value="libroFresadoTapaBlanda">libroFresadoTapaBlanda</option>');
|
||||||
|
selector.append('<option value="libroFresadoTapaDura">Fresado Tapa Dura</option>');
|
||||||
|
|
||||||
|
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{
|
else{
|
||||||
$(this).html('<input type="text" class="form-control " style="min-width:100px;max-width:120px;font-size:0.8rem !important;" />');
|
$(this).html('<input type="text" class="form-control " style="min-width:100px;max-width:120px;font-size:0.8rem !important;" />');
|
||||||
|
|
||||||
@ -140,7 +159,7 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
|||||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||||
pageLength: 50,
|
pageLength: 50,
|
||||||
lengthChange: true,
|
lengthChange: true,
|
||||||
"dom": 'lBrtip',
|
"dom": '<"mb-3"l>Brtip',
|
||||||
"buttons": [
|
"buttons": [
|
||||||
'colvis', 'copy', 'csv', 'excel', 'print', {
|
'colvis', 'copy', 'csv', 'excel', 'print', {
|
||||||
extend: 'pdfHtml5',
|
extend: 'pdfHtml5',
|
||||||
|
|||||||
@ -140,7 +140,7 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
|||||||
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500 ],
|
||||||
pageLength: 50,
|
pageLength: 50,
|
||||||
lengthChange: true,
|
lengthChange: true,
|
||||||
"dom": 'lBrtip',
|
"dom": '<"mb-3"l>Brtip',
|
||||||
"buttons": [
|
"buttons": [
|
||||||
'colvis', 'copy', 'csv', 'excel', 'print', {
|
'colvis', 'copy', 'csv', 'excel', 'print', {
|
||||||
extend: 'pdfHtml5',
|
extend: 'pdfHtml5',
|
||||||
|
|||||||
Reference in New Issue
Block a user