DataTables:禁用拖放 table 列
DataTables: Disable drag and drop table columns
我正在 table 上使用 DataTables 插件。我遇到的一个问题是我可以拖放 table header 将列移动到另一个位置。
我想禁用它。我一直在使用谷歌搜索并查看文档,但找不到答案。
这是我的代码
<script>
var oTable = $('#report_table').dataTable({
"paging" : false,
"sDom": 'RC<"clear">lfrtip',
"iDisplayLength": -1,
"aaSorting" : [],
"sPaginationType": "full_numbers",
"oLanguage": {
"sInfo": "" //Showing _START_ to _END_ of _TOTAL_ results
}
});
new FixedHeader(oTable);
</script>
有什么想法吗?
解决方案是根据@phillip100 的评论:
您是否包含 dataTables.colReorder.js 脚本?如果是这样,请从 sDom 选项中删除 R 字母。
我正在 table 上使用 DataTables 插件。我遇到的一个问题是我可以拖放 table header 将列移动到另一个位置。
我想禁用它。我一直在使用谷歌搜索并查看文档,但找不到答案。
这是我的代码
<script>
var oTable = $('#report_table').dataTable({
"paging" : false,
"sDom": 'RC<"clear">lfrtip',
"iDisplayLength": -1,
"aaSorting" : [],
"sPaginationType": "full_numbers",
"oLanguage": {
"sInfo": "" //Showing _START_ to _END_ of _TOTAL_ results
}
});
new FixedHeader(oTable);
</script>
有什么想法吗?
解决方案是根据@phillip100 的评论:
您是否包含 dataTables.colReorder.js 脚本?如果是这样,请从 sDom 选项中删除 R 字母。