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
1 Answer
Reset to default 3How 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.