nnm*_*nnm 3 ajax jquery datatables jquery-datatables
我希望在服务器端调用完成后为指定的URL隐藏一些列
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
});
Run Code Online (Sandbox Code Playgroud)
试试这个:
"drawCallback": function(settings) {
//do whatever
}
Run Code Online (Sandbox Code Playgroud)
https://datatables.net/reference/option/drawCallback
| 归档时间: |
|
| 查看次数: |
11959 次 |
| 最近记录: |