aaSorting returning extra element?
aaSorting returning extra element?
bill.martino
Posts: 38Questions: 0Answers: 0
I am trying to refer to the aaSorting array as such:
// get current sorting
var currentSort = oTable.fnSettings().aaSorting;
as i loop through the array, which at first contains only one element, I would expect to get back
3,desc
however, I am receiving
3,desc,1
any ideas?
// get current sorting
var currentSort = oTable.fnSettings().aaSorting;
as i loop through the array, which at first contains only one element, I would expect to get back
3,desc
however, I am receiving
3,desc,1
any ideas?
This discussion has been closed.
Replies
click 1: asc
click 2: desc
click 3: asc
click 4: asc
click 5: desc
...
Obviously you typically wouldn't want to do that - but it's an option in DataTables :-)
Another example where it is useful is if you have asSorting [ 'asc', 'desc' ] on the first column, but specify the default sorting as 'desc'.
So something that is required internally - if you have a look at the initialisation code, you can see where DataTables will add this to the array.
Allan