Sorting Is Not Working In JQuery Datatables
I have two inline tables in one page, sorting is working on one data table but not on other, calling both div's at a time, but sorting is working on only one data table. $('#div1')
Solution 1:
This should get you what you need
$(document).ready(function() {
$("#div2").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. you can find it here though http://datatables.net/ref
Post a Comment for "Sorting Is Not Working In JQuery Datatables"