数据表多列排序不起作用

时间:2016-07-29 19:09:17

标签: jquery mysql datatables

我是HTML表格

<table id="example" class="display" cellspacing="0" width="100%">
    <thead><tr><th>Name</th><th>Address</th><th>Phone</th><th>Email</th></tr></thead>
    <tfoot><tr><th>Name</th><th>Address</th><th>Phone</th><th>Email</th></tr></tfoot>
</table>
来自datatables.net的

和jquery blugin

$('#example').DataTable({
    "processing": true,
    "serverSide": true,
    "orderMulti": true,
    "aaSorting": [ [0,'asc'], [1,'asc'] ],
    "ajax": {
        url: "data.php",
        "type": "POST"
    }
}).fnSort( [ [0,'asc'], [1,'asc'] ] );

问题是如何将工作多表排序。如果我点击我点击地址表点击。我想点击地址标题更改其排序并保持名称排序。但是点击一个表,其他排序正在丢失。看图像。在按名称desc的sql查询顺序中,地址asc永远不会工作。 谢谢 enter image description here

1 个答案:

答案 0 :(得分:0)

您启用了服务器端排序:https://datatables.net/examples/server_side/

您实际上是在服务器端进行任何排序吗?