Hi!
I need to implement filter by select input to my table. I using serverside-processing to get data from DB and AJAX for dynamic actions.
Pagination, entries and search works fine but only this filter not, why?
Here is my code:
$(document).ready(function() {
table = $('#VolunteersList').DataTable({
searching: true,
"processing": true,
"serverSide": true,
"order": [],
"ajax": {
"url": "<?php echo site_url('wolontariat/przegladaj')?>",
"type": "POST"
},
"language": {
"url": "<?php echo site_url('assets/js/dataTables.Polish-lang.json') ?>"
},
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Wszystko"]],
"columnDefs": [
{
"targets": [ -1, 0, -2 ],
"orderable": false,
},
],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
nRow.className = aData[0 /* or whatever */] == "94" ? "HighlightUser" : "";
// USTAWIĆ ZWRACANIE HIGHLIGHT Z BAZY
return nRow;
},
});
});
setInterval( function () {
reload_table();
}, 5000 );
function reload_table() {
table.ajax.reload(null,false);
}
}