【发布时间】:2015-02-17 02:29:45
【问题描述】:
绘制数据表后,我将禁用用户订购的可能性。 我有一个数据表,我会订购数据并消除用户手动订购数据的可能性。 我该怎么做?
我使用了以下代码:
table = $('#tbl-1').DataTable({
"info": false,
"searching": true,
"paging": false,
"iDisplayLength": 25,
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tutti"]],
"language": {"url": "include/it_IT.txt"},
"order": [[1,"desc"]],
//"ordering": false,
//"orderFixed": {"pre": [ 1, "desc" ]},
"fnInitComplete": function(oSettings, json) {
//alert( 'DataTables has finished its initialisation.' );
this.fnFilter("<?php echo $_POST['search'];?>");
},
}).on('init.dt', function (e, settings, data) {
wrappa(); //after custom function
});
【问题讨论】:
-
我只是看到它,但在我的网站上不起作用
-
解决一些潜在的混淆。如果您希望在数据表初始化后禁用(例如服务器端排序的)表的自动排序,但保持启用排序功能以供有意使用,see here。如果您想完全禁用排序,请参阅下面的答案。
标签: javascript jquery datatables jquery-datatables