jquery datatables default sort not working
It worked for me. Thanks.. Initially I was using 'order':[2,'desc']
which was not working..Correct option is aaSorting
eg;
$(document).ready(function() {
$('#example1').DataTable({
aaSorting: [[0, 'desc']]
});
});
This should get you what you need
$(document).ready(function() {
$(".table-sortable").dataTable({
aaSorting: [[2, 'asc']],
bPaginate: false,
bFilter: false,
bInfo: false,
bSortable: true,
bRetrieve: true,
aoColumnDefs: [
{ "aTargets": [ 0 ], "bSortable": true },
{ "aTargets": [ 1 ], "bSortable": true },
{ "aTargets": [ 2 ], "bSortable": true },
{ "aTargets": [ 3 ], "bSortable": false }
]
});
});
The key is the aaSorting
option. For some reason it's not in his 'main' Usage pages... you can find it here though http://datatables.net/ref