How to make ColVis column list rebuilt after column reordering?
How to make ColVis column list rebuilt after column reordering?
Hi,
We have changed to DataTables 1.10.13 from an older version where ColVis was not a part of Buttons. Now I'm trying to rewrite the affected parts to use ColVis with Buttons, but I've run into a problem.
Before a ColVis object has been created and then it was possible to use its "rebuild" (or fnRebuild) function to refresh its column list after a column reordering. But in this current version I can't find any reference how it can be done. I use ColReorder for column reordering.
The table is initiaized this way:
oTable = $('.deptable').DataTable({
pagingType: "full_numbers",
stateSave: true,
stateDuration: -1,
colReorder: true,
dom: '<"clearfix"<"pull-left"l><"pull-right"<"pull-right"B><"pull-right"f>>>rtp',
buttons: {
dom: {
button: {
tag: 'div'
},
buttonLiner: {
tag: null
}
},
buttons: [
{
extend: 'colvis',
text: '<i class="icon-th-list"></i>'
}
]
},
initComplete: function () {
$(this).wrap("<div class='table-responsive table-responsive-lg'></div>");
},
columnDefs: [
{'orderable': false, 'targets': [0]}
],
order: [
[1, "asc"]
]
});
How can I make the ColVis column list to refresh after reordering? Is there a built in way or should I write an own function for this?
Thanks in advance.