Filters get cached in the Datatable
Filters get cached in the Datatable
Mauro26
Posts: 17Questions: 7Answers: 0
Hi guys,
I'm having a problem, everytime I make a search and then I reload the page the field is empty but the filtering is still there.
I'm having 5 results out of 900 after refreshing the page and having all the filter fields empty.
This is the filter
Order No
$('#ID_textcontrol6A61BBF2')
.on( 'keyup', function () {
var val = $(this).val();
table.fnFilter($(this).val(), table.api().column('docNumber:name').index());
} );
and this is what I'm trying to use to reset the filters after the refresh of the whole page.
$.fn.dataTable.ext.search = [];
table.fnFilter('');
But it doesn't work.
It shows "Showing 0 to 0 entries out of 12"
This discussion has been closed.
Answers
Do you have
stateSave
enabled?Kevin
Hi Kevin,
Yes I have it in true, it could be that?
Regards.
According to the
stateSave
docs:You can use
stateSaveParams
to remove the items you don''d want saved. Looks like you are doing a column search so you could reset all those to '""'. Use the browser's debugger or console log to investigate the contents of the
data` parameter to see what you need to do to clear the column searches.Kevin