Disable Initial Sort

Disable Initial Sort

bryceray1121bryceray1121 Posts: 65Questions: 0Answers: 0
edited March 2011 in General
Hello,

What I'm trying to do is disable the initial sort for a single datatable. I have multiple data tables on the page but I want to set 1 of the tables up so that it does not sort on page initialization. However, I want the sort features to work if they are clicked on after the page initialization. The purpose of this is to allow me to be able to define the rows that initially appear at the top of the table.

I've tried this but I assume it does not work because bSort refers to a table as a whole instead of an individual column.
[code]
"aoColumnDefs": [
{"bSort":false, "aTargets" : ["dataTables_noIniSort"]}
]
[/code]
*With this code I added the class to every column in the table.

Thanks for your help.

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    Set aaSorting ( http://datatables.net/usage/options#aaSorting ) to an empty array to have no initial sort.

    Allan
This discussion has been closed.