Reputation: 27717
Is there a way in JQuery Datatables to get the current filter status of a column? I am doing some custom filtering and have bStateSave set to true. When the page reloads I would like to read out the current filter state in order to populate a different portion on my page.
Upvotes: 1
Views: 4339
Reputation: 1079
For anybody still looking (like I was):
var oSettings = oTable.fnSettings();
$("tfoot input").each(function(i){
if(oSettings.aoPreSearchCols[i]['sSearch']!=''){
$(this).val(oSettings.aoPreSearchCols[i]['sSearch']);
}
});
if(oSettings.oPreviousSearch['sSearch']!=''){
$('.search_field').val(oSettings.oPreviousSearch['sSearch']);
}
Upvotes: 6