Avoid datatable refresh/reload on column show/hide
Avoid datatable refresh/reload on column show/hide
Currently
When I tried to implement add/remove columns, am able to see column add/remove working fine, but the table is getting refresh entirely which I want to avoid.
Below is the sample code
function showHideColumns(e)
{
var column = jQuery('#Table').DataTable().column(3);
// Toggle the visibility
column.visible( ! column.visible() );
e.preventDefault();
}
Answers
The Question here is am able to add/remove columns successfully, but for example i have 10 columns initially when loaded, then add/remove on 10 columns hapening fine without horizontal scrollbar on datatable.I have statesave =true on datatable.For example, I did add/remove and finally end with 8 columns.When I reload again , am getting 8 columns, but when I tried to add the column its width not getting re-adjusted.