我正在使用以下数据属性来隐藏一列。
data.aoColumnDefs = [ {
"bVisible": false,
"aTargets": [ 9 ]
}];
此列的每一行都有复选框。要添加复选框,我在每一行上调用以下方法,它工作正常。
_buildCheckBox : function() {
var newScriptElement = $("<input type='checkbox' class='re-execute-check' />");
return $('<div>').append(newScriptElement.eq(0).clone()).html();
}
稍后在一种情况下,我尝试使用 fnSetColumnVis 方法显示此列。
var table = this._resultsTable.dataTable();
table.fnSetColumnVis(9, true);
有了这个我可以看到列,但没有为每一行显示复选框。有没有其他方法可以做到这一点?