How to dynamically change searchable columns in datatable?

I need to implement functionality in DataTables to set the search property for columns to true / false dynamically.

https://datatables.net/

I implemented this in one way.

dataObject.settings()[0].aoColumns[index].bSearchable = true;                   
dataObject.clear();
dataObject.rows.add(data);
dataObject.draw();

It only works when clearing all data in a DataTable and repeating, but that is not the right way.

It must update the search property dynamically. It should be updated without clearing data.

Are there any other options when using DataTables to dynamically change the search property and without overwriting?

+4
source share
1 answer

After the change, bSearchablecall invalidate()to clear the cache.

dataObject.rows () invalid () ;.

: -

0

Source: https://habr.com/ru/post/1667423/


All Articles