我正在使用数据表进行用户输入,我在其中插入新行。
以下是我的代码:
$('#invoice-content-table').dataTable({
"bPaginate": false,
"sScrollY": "150px",
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false,
"aaSorting": [],
"bDestroy":true,
"aoColumns": [
{ "sWidth": "170px", "bSortable": false,"asSorting":[] },
{ "sWidth": "30px", "bSortable": false, "asSorting": [] },
{ "sWidth": "30px", "bSortable": false, "asSorting": [] },
{ "sWidth": "40px", "bSortable": false, "asSorting": [] },
{ "sWidth": "25px", "bSortable": false, "asSorting": [] },
{ "sWidth": "25px", "bSortable": false, "asSorting": [] },
{ "sWidth": "25px", "bSortable": false, "asSorting": [] },
{ "sWidth": "25px", "bSortable": false, "asSorting": [] },
{ "sWidth": "25px", "bSortable": false, "asSorting": [] },
{ "sWidth": "30px", "bSortable": false, "asSorting": [] },
{ "sWidth": "50px", "bSortable": false, "asSorting": [] }
]
});
问题是无论何时插入新行,它都会默认排序。我试过设置 aaSorting:[]数组为null,但仍然没有运气。如何禁用它?