Hi,
Can anyone see what is wrong with this?
Following the example from : https://datatables.net/examples/api/multi_filter_select.html
The selects are appearing but the search is not doing anything. No errors in the console.
Thanks,
Mick
debug code: okixan
$(document).ready(function () {
var table = $('#lookupTable').DataTable({
initComplete: function () {
this.api().columns().every( function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.footer()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
},
responsive: true,
@if ($pagination != 1)
"paging": false,
@endif
@if($show_export_buttons === 1)
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
@endif
"processing": true,
"pageLength": 25,
"bFilter": false,
"columnDefs": [
{
"targets": [ -1 ],
"visible": false,
"searchable": false
}
],
//This adds the Bootstrap alert class, if there is one in the last column
"createdRow": function( row, data, dataIndex ) {
/*console.log(data);*/
if ( data[data.length-1] != '' ) {
$(row).addClass( data[data.length-1] );
}
}
});
new $.fn.dataTable.FixedHeader( table );
$('#loader').hide();
$('#lookupTable').show();
});