0

I have a table populated with dataTabels jquery plugin.
after i use colReorder plugin on it and reorder my columns,
how can i get all my collumns order.
let me explain little more.
if i have all my columns visible it is fairly easy. but when i make some columns disapear with colViz plugin of dataTables it destroy the whole column and its not there for me to get any thing of it.
the problem is that i know that the order is present somewhere in the oTable object, because when you change the order of columns in your table with colReorder in colViz list the order changes and it containes all my columns names.
i searched all three of js files thoroughly. but could not found any thing helpfull.
though i can not use the colVix button names, because they are not present in page and after i click on show/hide columns list they are generated. in addition i can not trigger a click on it because it has a fairly long animation that make it almost impossible to use this cheap tricks on it. can any one help?

EDIT:
i think it is clear:
i just want a list with titles of my columns visible or hidden especially after using reorder

4

1 回答 1

0

您可以使用colVis按钮单击来根据选中的复选框创建数组:

$(document).on('click', '.ColVis_Button:not(.ColVis_MasterButton)',function(){
     var colsArray= $('.ColVis_Button :checkbox').map(function(){
      return [[$(this).parent().next('.ColVis_title').text(), this.checked ? 'visibile':'hidden']];
    }).get();
    console.log(colsArray)

});
于 2013-01-26T14:32:06.220 回答