我有一个包含 9 列的数据表,列 [0] 和 [8] 被隐藏。然后将列 [7] 和 [8] 合并为一列(参见下面的代码)。
我正在努力解决的问题是当我隐藏一列时使用 ColVis 插件,列 [7] 和 [8] 的合并搞砸了。
希望这是有道理的,任何帮助将不胜感激。
var $buTable= $("#business_table").dataTable( {
"oLanguage": {
"sSearch": "Filter:"
},
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/business_serverside.php",
"iDisplayLength": 10,
"bJQueryUI": false,
"sPaginationType": "scrolling",
"sDom": '<"clear"><"top"CTilr<"clear">pt>',
"aoColumns": [
{"bVisible":false},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":true},
{"bVisible":false}
],
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
$('td:eq(6)', nRow).html(''+ aData[7] +' '+ aData[8] +'');
},
"oTableTools": {
"sSwfPath": "swf/copy_csv_xls_pdf.swf"
},
"oColVis": {
"activate": "mouseover",
"aiExclude": [0,8]
}
}).columnFilter({
aoColumns: [
{ type: "select"},
{ type: "text" },
{ type: "select" },
{ type: "select"},
{ type: "text"},
{ type: "text"},
{ type: "select"},
{ type: "text"}
]
});