Can I turn column option "searchable" on and off through the API?
Can I turn column option "searchable" on and off through the API?
I have several search fields that are each tied to a specific column and I use datatable.columns(4).search(search).draw();
to search in that specific column only. However I don't want the main filter search on the entire table to search these columns so I specify searchable = false
on each of these columns. The problem is that the specific search boxes then no longer work.
As an alternative, can I restrict the main table's filter to certain columns without relying on column searchable
?
Answers
Give this plugin a look over and see if it could solve your problem.
I'm afraid the DataTables core API does not provide a way to change the
columns.searchable
option after initialisation. That is something I hope to add in future.No. You would need to implement custom filtering to do that.
Allan