Datatables Filter on first 4 columns
Datatables Filter on first 4 columns

I have no experience with JS so please use small words!
I look at filter api, but my js skills are poor.
I want to filter the Datatable based on the first 1-4 invisible columns. (col1=?) AND (col2=?)... So could be just 1st col, could be all 4.
I would like to apply each filter request on button click event.
Could someone point me in right direction?
Also how to remove a filter?
thank you in advance for your help for my very noob questions.
This question has an accepted answers - jump to answer
Answers
The
column().search()
API is used to search the table on a column by column basis. You could usecolumns().search()
to search multiple columns for the same search term. Column numbers start counting from 0. The first column is 0.Here is a simple example searching a hidden column via a button:
http://live.datatables.net/wuhelusa/1/edit
See the same example. Use an empty string, ie
""
, to clear the search.Kevin
Thank you! For Multi this work very nice:
table.column(0).search('tiger');
table.column(1).search('sys');
table.column(2).search('');
table.column(3).search('').draw();