Filter rows and draw without using search V1.10.15
Filter rows and draw without using search V1.10.15
Dear community,
I would like to filter rows based on a cell value, while still being able to use the search functionality.
In this example im using table.search(66).draw();
to filter a table. This works but i can't use the search field to further narrow it down.
http://live.datatables.net/cupabuqi/2/edit?js,output
I've tried to use the .filter() function:
$(document).ready( function () {
var table = $('#myTable').DataTable();
table .column( 3 )
.data()
.filter( function ( value, index ) {
return value == 66 ? true : false;
} ).draw();
But it doesn't seem to work.
Can anyone point me in the right direction?
Thank you for your time and have a great day!
This question has an accepted answers - jump to answer
Answers
The
filter()
documentation states:If you want to provide a custom function to search the table you need to use a custom plug-in (currently).
Allan
I got it working by using
column().search()