Disable column search dynamically
Disable column search dynamically
JPelletier
Posts: 2Questions: 1Answers: 0
Hi all,
I would like to know if I can disable "searchable" property of a column dynamically. I have controls to hide columns but i also want to disable searching when a column is hidden. I'm using DataTables 1.10.11
Something like this:
column.visible(!column.visible());
column.searchable(column.visible()); // Doesn't exist
Thanks a lot for help
This discussion has been closed.
Answers
Did you find a solution for this?
No, I have a lot of stuff to work on so this is really minor priority for me
There isn't currently such an API method. The full list is available and I'm afraid there is no way to dynamically change the searchable property at the moment. It is something I'm considering for a future release.
Allan
I came up with a solution (not elegant - however it does work)
Essentially it omits the hidden column's data and searches on the row's data again.
(semi-stolen) from the source code