我希望在服务器端调用完成后为指定的URL隐藏一些列 sAjaxSource:url, 在我完成使用fnCreatedRow创建行之后.我想执行列可见性语句 table.fnSetColumnVis(0,false,false); 对于此回调中的多个列.有没有
sAjaxSource:url,
在我完成使用fnCreatedRow创建行之后.我想执行列可见性语句
table.fnSetColumnVis(0,false,false);
对于此回调中的多个列.有没有办法在datatable中执行此操作?我尝试过使用fnDrawCallback和fnRowCallback但它们根本不执行.
我写的代码如下.
table = $('#ID').dataTable({
"bServerSide": true,
"bProcessing": true,
"autowidth": true,
//"bInfo": false,
"dom": 'C<"clear">lfrtip',
"scrollY": "350px",
"scrollCollapse": false,
"paging": true,
"scrollX": true,
"destroy":true,
"sAjaxSource": url,
"aoColumns": [
{
"targets": 0,
//"bVisible": true,
"title": "Select Client",
"bSearchable": false,
"bSortable": false,
"width": "10%"
},//Many such entries
],
"fnCreatedRow": function (nRow, aaData, iDataIndex) {
//Function body
},
"drawCallBack" : //Actual code that i want to get executed after fnCreatedRow has ended
});
试试这个:
"drawCallback": function(settings) {
//do whatever
}
https://datatables.net/reference/option/drawCallback
