There's a lot of questions about separating filter on each columns. But none of them I have found about the same question, but of course with a touch of AJAX.
I'm using datatables for almost a month. While searching for a cool stuff I can add to my datatable, I found a site that has this datatable with filter on each columns. I want to have that but I can't figure it out how.
I've read some documentation in Datatables, but it seems to be difficult for me to understand it. So can someone help me to fix my problem?
By the way here's my AJAX code:
var initAjaxDatatables = function () {
var grid = new Datatable();
grid.init({
src: $("#applicationTracker"),
loadingMessage: 'Loading...',
dataTable: {
"bStateSave": true,
"lengthMenu": [
[10, 20, 50, 100, 150, -1],
[10, 20, 50, 100, 150, "All"]
],
"pageLength": 10,
"ajax": {
"url": root_path + "/public/ajax/report/application/LoadAllDataAsync/",
},
"order": [
[1, "asc"]
],
buttons: [
{ extend: 'print', className: 'btn default' },
{ extend: 'copy', className: 'btn default' },
{ extend: 'pdf', className: 'btn default' },
{ extend: 'excel', className: 'btn default' },
{ extend: 'csv', className: 'btn default' },
{
text: 'Reload',
className: 'btn default',
action: function ( e, dt, node, config ) {
dt.ajax.reload();
}
}
],
}
});
// handle datatable custom tools
$('#datatable_ajax_tools > li > a.tool-action').on('click', function() {
var action = $(this).attr('data-action');
grid.getDataTable().button(action).trigger();
});