I’ve been trying to figure this out now for a few hours and its not happening. When I load my table I need for it to sort desc on the first col. Here’s what I have but no luck.
/**
* Makes the table in the tabs for reports
*
* @param array Holds the data for datatable.
**/
var makeTabTable = function(tableData){
$("#tab_active_reg").dataTable({
bJQueryUI : true,
bDestroy : true,
aoColumns : [
{"sTitle" : "Seen", "sWidth" : "50px", "asSorting": [ "desc"]},
{"sTitle" : "Sold", "sWidth" : "50px"},
{"sTitle" : "Name", "sWidth" : "240px"}
],
aaData : tableData
});
$('.tabsComponent').find('.fg-toolbar').empty();
};
just add this option to the
dataTable()call:so in your case:
as you can see, it is an array of
[colnumber, sortdirection], so you can specify multiple.