how to change "searchable" columns dynamically?

how to change "searchable" columns dynamically?

RPokrovskijRPokrovskij 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?

Replies

  • allanallan Posts: 61,893Questions: 1Answers: 10,145 Site admin

    You won't be able to find it because it doesn't exist! It is something I am considering for a future version.

    Allan

  • RPokrovskijRPokrovskij Posts: 8Questions: 2Answers: 0

    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.

  • ignignoktignignokt Posts: 146Questions: 4Answers: 39

    If you are using server-side you can control which columns the search hits on the back-end fairly easily.

  • allanallan Posts: 61,893Questions: 1Answers: 10,145 Site admin

    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

  • ignignoktignignokt Posts: 146Questions: 4Answers: 39

    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.

This discussion has been closed.