是否可以动态更改jQuery DataTables ColVis扩展程序exclude
?
我有数据表
$("#calc_tabl").DataTable({
paging: false,
colVis: {
buttonText: "Show/hide",
//exclude: [0]
},
dom: 'C<"clear">frtiS'
});
单击我要更改排除列的按钮,但我不需要重新加载整个表。
$("#calc_tabl").DataTable({
paging: false,
colVis: {
buttonText: "Show/hide",
exclude: [2,3]
},
dom: 'C<"clear">frtiS'
});
有fnSettings()
函数,如
$(document).ready(function() {
var oTable = $('#example').dataTable();
var oSettings = oTable.fnSettings();
alert( oSettings );
} );
也许可以从oSettings
中提取ColVis选项?但是没有“ColVis”或相同的参数。
答案 0 :(得分:0)
According to this post by Allan Jardine, creator of jQuery DataTables, changing excluded columns on the fly wasn't possible with ColVis extension.
Alternative option could be to re-initialize your table.