No automatic sort?

No automatic sort?

RemiDGRemiDG Posts: 15Questions: 0Answers: 0
edited April 2013 in General
Currently it seems like the datatables are sorted by the order of the contents from the first column. I'd like to have a possibility, where the default sorting order is as the table is created in the HTML. So:
[code]


Number


2
1
3


[/code]
would be displaying 2-1-3, not 1-2-3.

Replies

  • allanallan Posts: 63,230Questions: 1Answers: 10,416 Site admin
    Yup - no problem. Just set the aaSorting option to be an empty array in the initialisation of your table. That will apply no default sort, but allow the user to sort the table if they want.

    Allan
  • RemiDGRemiDG Posts: 15Questions: 0Answers: 0
    Empty array as in [] or as in [[]]? As aaSorting is usually a multidemsional array :P
  • allanallan Posts: 63,230Questions: 1Answers: 10,416 Site admin
    Just an empty array: `[]` - each element in that 'top level' array defines a sorting command, and since you want non, just make it an empty array.

    Allan
This discussion has been closed.