显示带有数据表的选定记录,if(documentType!= X)
如何使用Datatables实现上述代码,下面的代码已经实现并正常工作。它在Ajax调用并填充表后从JSON获取数据。
columnDefs: [
{"width": "20%", targets: 0},
{"width": "40%", targets: 1},
{"width": "40%", targets: 2} //Set the width
],
columns: [
{"data": "documentType"},
{"data": "fileName"}, //Display Linked file name
{"data": "documentDate"}
],
aoColumnDefs: [ {
"aTargets": [ 1 ],
"mData": "fileName",
"mRender": function ( data, type, full ) {
return '<a href="'+full.link+'">'+full.fileName+'</a>'; //Supply link to file
}
}]