默认情况下,订单在数据表中不起作用

时间:2018-04-19 11:48:54

标签: javascript jquery datatables

我们使用Datatable和ajax提取的服务器端数据。

但是,"order": [[ 0, "desc" ]]无效

这是我的数据表代码

columns = [
  { "data": "fee" },
  { "data": "net_total" }
];

$('#fundViewLatest').dataTable({
  oLanguage: {
  sLengthMenu: "<select class='btn btn-primary dropdown-toggle' data-toggle='dropdown' aria-haspopup='true'>" +
    "<option value='10' class='dropdown-item'>10</option>" +
    "<option value='ALL' class='dropdown-item'>ALL</option>" +
    "</select>"
  },
  "pageLength": 20,
  "bServerSide": true,
  "processing": true,
  "deferRender": true,
  "bLengthChange": false, // can change the length
  "order": [ [ 0, "desc" ] ],
  "ajax": {
    "url": MailUrl + 'pages/fundviewlatest',
    "type": "GET"
  },
  "columns": columns,
  "fnRowCallback": function(nRow, aData, iDisplayIndex) {}
});

0 个答案:

没有答案