Search only on one column
Search only on one column
spiderkzn
Posts: 44Questions: 12Answers: 0
Hi,
I have Datatable which display whole data no problem. However the search input that when I type it filter everything in table. but I would like to filter on one specific column.
I've tried add searchable: false, and it not working.
Please help
This question has an accepted answers - jump to answer
Answers
If you want to use the global search field for that you can set the other columns to "not searchable"
If you use a class for those columns you could do:
Alternatively you can hard code the columns positions and do it like this:
Use
columns.searchable
to disable search on specific columns. In this case disable it on all but the one you want to be searchable.Allan
Thank you rf1234, the code below has solved the problem.
{targets: [0, 1, 2, 3, 4, 5], searchable: false}