What's wrong with my ordering??
What's wrong with my ordering??
Connorln3
Posts: 6Questions: 3Answers: 0
I cannot get the inital ordering I want to work, I want to sort column 5 descending AND column 1 ascending. It only is sorting by the first one (5 how it is presented below):
allTable = $('#allTable').DataTable({
"order": [[ 5, 'desc' ],[1, 'asc']],
"aLengthMenu": [[10, 25, 50], [10, 25, 50]],
"processing": true,
"serverSide": true,
"ajax": "/parentclub/parentclub/allData",
"rowCallback": function( row, data ) {
if ( $.inArray(data.DT_RowId, selected) !== -1 ) {
$(row).addClass('selected');
}
},
/*"oLanguage": {
"sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)"
}*/
"columnDefs": [
{
"targets": [ 0 ],
"visible": false,
"searchable": false,
},
{ "bSortable": false, "aTargets": [ 3 ] }
]
})
This discussion has been closed.
Answers
I also tried using "aaSorting": [[ 5, 'desc'],[ 1, 'asc']] instead of order. still it wont sort on both.
Try to replace :
"order": [[ 5, 'desc' ],[1, 'asc']],
By
'aaSorting': [[ 5, 'desc'],[ 1, 'asc' ] ],
I tried that already, comment above yours.
The ordering is being done at the server-side, so if there is a problem with the ordering, the problem is in
/parentclub/parentclub/allData
Allan