how to change "searchable" columns dynamically?
how to change "searchable" columns dynamically?
RPokrovskij
Posts: 8Questions: 2Answers: 0
I want to integrate "colvis" with search filter. I can catch "'column-visibility.dt" event but can't find the way how to manipulate "searchable" configuration dynamically... Any ideas?
This discussion has been closed.
Replies
You won't be able to find it because it doesn't exist! It is something I am considering for a future version.
Allan
Thank you allan. Would be it possible to shortly describe architecture of search? Then it will become clear for me what to choose: to wait or to try to find what to tweak in the internals by myself.
If you are using server-side you can control which columns the search hits on the back-end fairly easily.
I don't really know what would be involved in making the searchablility of columns dynamic myself. It was never designed that way so would likely involve a fair amount of work.
Allan
The way I have my server-side working, you could pass an array of data (if they are in a column or not) and every search will use that array. It is passed as
$searchable
.I just define this in the controller for every datatable, but you could easily make it dynamic by setting it every server-side call through datatables with a JS array.