Searching a datatable with ajax datasource
Searching a datatable with ajax datasource
I'm trying to add a custom search box to my datatable. Most of the questions, answers and examples I came across over internet are using hardcoded html datatables but I'm getting my data via an Ajax function. I'm trying to conduct a search (it works as a filter if I got it right) by using this jquery function.
$(function () {
$('#inpSearch').on('keyup', function () {
//alert(this.value);
datatable
.search(this.value)
.draw();
});
but it is not working.
inpSearch is the name of the input box I put above the datatable. I'm using datatables version 1.10.5
Can someone show me the right way to do this? Also I want to add a date range filtering too.