Prevent the jquery datatable to restore to initial state when clicking the toggle button

一个人想着一个人 提交于 2020-01-05 20:00:50

问题


Here I have a bootstrap styled fixed column datatable where i can toggle the columns by a button as,

 $('#ToggleColumns').click(function () { 
      table.destroy();
  if(columnNumber == 2)
  {
columnNumber = 0;  
  }
  else {
  columnNumber = 2; 
  }
  });

If I am at the 3rd page of datatable pagination and when I toggling the columns, the table restores to its initial position. ie, first page. How can I prevent it and be there in the 3rd page itself after toggling? The same applies to the no. of record selection too.

来源:https://stackoverflow.com/questions/26436791/prevent-the-jquery-datatable-to-restore-to-initial-state-when-clicking-the-toggl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!