数据表禁用初始排序

时间:2013-12-20 04:49:48

标签: javascript jquery html datatables jquery-datatables

我正在使用数据表进行用户输入,我在其中插入新行。

以下是我的代码:

$('#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,但仍然没有运气。如何禁用它?

0 个答案:

没有答案