Sorting with hidden columns in Dynatable

孤者浪人 提交于 2020-02-05 08:41:06

问题


I'm using Dynatable to display ajax data in a table. The table has lots of columns, so to make it easier to understand I have buttons to only show certain columns at one time. That works find until I try to sort by a column, at which point it unhides the other columns. I've tried to replicate the problem in this jsfiddle. The dynatable part of it is pretty straight forward, although I have to copy header classes in order for it to hide the corresponding columns when the right buttons are clicked:

$('#my-final-table').dynatable({
  dataset: {
    records: jsondata
  },
  table: {
    copyHeaderClass: true
  }
});

As you can see with the jsfiddle, if you hide some of the columns (using the buttons) and then sort by one of the remaining columns, all of the hidden columns reappear.

Has anyone else gotten Dynatable's sort function to work while also hiding some of the columns?

Thanks a lot, Alex


回答1:


I had no luck finding a solution to this in Dynatable, so I switched over to Datatables, where sorting hidden columns doesn't seem to be an issue.



来源:https://stackoverflow.com/questions/23715784/sorting-with-hidden-columns-in-dynatable

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