我知道这是一个旧帖子,但今天我遇到了同样的问题,下面的解决方案适用于我。它将从第一列中删除排序图标。
$('#table').dataTable({
'columnDefs': [{ 'orderable': false, 'targets': 0 }], // hide sort icon on header of first column
'aaSorting': [[1, 'asc']] // start to sort data in second column
});
"order": [[1, 'asc']]
如果为该列禁用排序,则将删除第一列中的排序图标。
$("#reportgrid").dataTable({"order": [],
"aoColumns": [
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false },
{ "bSortable": false }
],
"sDom": '<"top">rt<"bottom"lp><"clear">'});
请尝试以下步骤以获取最新版本:
$('#reportgrid').dataTable( {
"columnDefs": [
{ "orderable": false, "targets": 0 }
]
} );
$("#reportgrid").DataTable({
"ordering": false,
"iDisplayLength": 10,
"sDom": '<"top">rt<"bottom"lp><"clear">',
})