[英]DataTable bSortable columnDefs issue
$(document).ready(function () {
var dt = $('#example').DataTable({
"processing": true,
"serverSide": true,
"ajax": "api.php?t=clients",
"aoColumnDefs": [{
'bSortable': false,
'aTargets': [0]
}],
"columns": [{
"className": "details-control",
"data": null,
"defaultContent": " "
}, {
"data": "c_name"
}, {
"data": "c_number"
}, {
"data": "c_link"
}]
});
});
My code throw an error of SQL access violation when I included the following with 当我在以下代码中包含以下内容时,我的代码会引发SQL访问冲突错误:
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [0] }
]
But if i remove it, everything works fine, basically I just want disable sorting for column 0 但是如果我删除它,一切正常,基本上我只想禁用列0的排序
How do I achieve it. 我该如何实现。
Thanks!! 谢谢!!
Change "aoColumnDefs" to "columnDefs" 将“ aoColumnDefs”更改为“ columnDefs”
"columnDefs": [{
'bSortable': false, 'aTargets': [0]
}]
make sure you include these script files: 确保包括以下脚本文件:
http://code.jquery.com/jquery-1.11.3.min.js https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js http://code.jquery.com/jquery-1.11.3.min.js https://cdn.datatables.net/1.10.9/js/jquery.dataTables.min.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.