Existing data filter on ajax loaded data
Existing data filter on ajax loaded data
Is there a way to filter (column and custom) loaded data across pages without making a call to ajax end point? I have implemented the sample -column filter as below...
var table = $("#" + dataTable).DataTable();
$("#" + dataTable + " thead").on('keyup', ".column_search", function () {
const l = this.value.length;
if (l === 0 || l > 3) {
table
.column($(this).parent().index())
.search(l === 0 ? "" : this.value)
.draw();
} else {
return false;
}
});
It works but the issue is that it makes a call to ajax end point. Please suggest a way to filter fetched dataset without making a call back.
Answers
Sounds like you have server side processing enabled (
serverside: true
). If this is the case then that behavior is expected as server side processing performs all searching, sorting and paging. Please see the ]server side processing docs](https://datatables.net/manual/server-side) for more details.If you aren't using server side processing then please provide more details of what you have. A link to your page or a test case would be best.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin