Avoid datatable refresh/reload on column show/hide

Avoid datatable refresh/reload on column show/hide

bubby248bubby248 Posts: 6Questions: 4Answers: 0

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

  • bubby248bubby248 Posts: 6Questions: 4Answers: 0

    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.

This discussion has been closed.