I need to implement a functionality in DataTables to set the searchable property for columns to true / false dynamically.
https://datatables.net/
I have implemented this in one way.
dataObject.settings()[0].aoColumns[index].bSearchable = true;
dataObject.clear();
dataObject.rows.add(data);
dataObject.draw();
It is only working by clearing all data in the DataTable and rebinding but this is not the correct way.
It should update the search property dynamically. It should update without clearing the data.
Are there any other options when using DataTables to change the searchable property dynamically and without rebinding?
After changed bSearchable
, call invalidate()
to clear the cache.
dataObject.rows().invalidate();
Ref: DataTables - dynamically set columns searchable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With