All,
I’m using the following theme which utilizes the datatable plugin:
http://revaxarts-themes.com/whitelabel/datatable.html
Things work great except for one thing. I’m trying to sort my table in descending order on the first column when it loads. Currently it only sorts it in Ascending order. Here is a JS Fiddle that has the JS file that is included in theme:
I found this line in there (line 1077 on that):
/*
* Variable: aaSorting
* Purpose: Sorting information
* Scope: jQuery.dataTable.classSettings
* Notes: Index 0 - column number
* Index 1 - current sorting direction
* Index 2 - index of asSorting for this column
*/
this.aaSorting = [ [0, 'asc', 0] ];
I changed this to the following value:
this.aaSorting = [ [0, 'desc', 0] ];
This still sorts my initial column in ascending order. Is there another value that I have to set?
Thanks for any help in advance!
Have you looked through the docs of datatable here. Instead of modifying the original sourcecode, you should pass in the sort order when you first initialize datatable.
You can pass in the sort order using the
aaSortingproperty like sojsFiddle Here