$('#example').dataTable({
bStateSave: true,
fnStateLoadCallback: function( oSettings, oData ) {
oData.sFilter = '';
for (var i = 0; i < oData.aaSearchCols.length; i++)
oData.aaSearchCols[i][0] = '';
return true;
}
});
$('#example').dataTable({
bStateSave: true,
fnStateSaveParams: function( oSettings, oData ) {
oData.oSearch.sSearch = '';
for (var i = 0; i < oData.aoSearchCols.length; i++) {
oData.aoSearchCols[i].sSearch = '';
}
}
});
1. I wanted an ability to filter one column by entered text and another column by value from dropdown list. At the moment it's needed to code separately.
2. When filtering by column and having server-side processing, the server-side script is bothered immediately after each change in the filter box
The fnFilter API method is provided to allow access to the filtering controls that DataTables has, and I presume you ended up using that. However, presenting filtering controls for individual columns, and in different ways, would add a lot of weight to DataTables core, and I want to keep the software as slim as possible. It sounds ripe for a plug-in thought!
Have a look at this plug-in ( http://datatables.net/plug-ins/api#fnSetFilteringDelay ) which introduced a key debounce to address this issue.
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.