javascript - Datatables ServerSide sort not working. What has gone wrong? - Stack Overflow

I'm using datatables with server side processing. Everything works fine, except the sort function.

I'm using datatables with server side processing. Everything works fine, except the sort function. It doesn't show any errors in the console. What could be happening?

$('#example').DataTable({
        "lengthMenu": [[5, 10, 15, 20], [5, 10, 15, 20]],
        'paging': true,
        'info': true,
        'filter': true,
        'stateSave': true,
        'processing': true,
        'serverSide': true,
        'aaSorting': [[2, 'asc']],
        'bSortable': true,
        'bProcessing': true,
});

I'm using datatables with server side processing. Everything works fine, except the sort function. It doesn't show any errors in the console. What could be happening?

$('#example').DataTable({
        "lengthMenu": [[5, 10, 15, 20], [5, 10, 15, 20]],
        'paging': true,
        'info': true,
        'filter': true,
        'stateSave': true,
        'processing': true,
        'serverSide': true,
        'aaSorting': [[2, 'asc']],
        'bSortable': true,
        'bProcessing': true,
});
Share Improve this question edited Aug 2, 2019 at 22:20 DavidHyogo 2,9064 gold badges32 silver badges50 bronze badges asked Mar 17, 2017 at 22:41 Eduardo ChiquitoEduardo Chiquito 451 silver badge9 bronze badges 1
  • What do you use as serverside hanler script? – Behrad Khodayar Commented Mar 17, 2017 at 22:56
Add a ment  | 

1 Answer 1

Reset to default 3

How do you process sorting on the server side? That's what datatables is sending to the server:

order[0][column]:column_number
order[0][dir]:direction(asc|desc)

Column number is 0-based You have to sort the data on the server side.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745315805a4622213.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信