Per-Column searching not working
Per-Column searching not working
reastwood
Posts: 3Questions: 0Answers: 0
Hello!
I've hit an issue with trying to search on a per column basis. I am using code based on the example here:
https://datatables.net/reference/api/column%28%29.search%28%29
I'm using this to load the table
$('table.dataTables').dataTable({
ajax: "url/blah/somedata.json",
ordering: false,
columns: [
{ data: 'client' },
{ data: 'config' },
{ data: 'code' },
{ data: 'vouchernumber' }
],
});
The table loads fine.
Then to test the searching i'm just using a button for now, the idea being it looks in the config column for the value of 60.
$("#test").click(function(){
$('table.dataTables').column(1).search("60").draw();
});
However, I get an error when the button is hit:
$(...).column is not a function
Any ideas much appreciated!!
Rob
This discussion has been closed.
Replies
Forget it, me being stupid. Had to call datatables on the table again:
There is a difference between
$().dataTable()
and$().DataTable()
. See the FAQ.Allan
Cheers!