我们使用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) {}
});