Preserve original ordering but also bSort=true?
Preserve original ordering but also bSort=true?
Hi, I'm creating a DataTable client-side by transforming an HTML table. I want this table to be sortable by the user, which I can do with bSort=true, BUT I'd like the table to be initially presented in its original ordering within the HTML. Currently, when I set bSort=true, and don't provide sort columns, the table is automatically sorted by column 0.
Alternatively, is there any way to initialize a DataTable within the rather than the of a page? Being able to do either of the above would solve my problem.
Many thanks.
Alternatively, is there any way to initialize a DataTable within the rather than the of a page? Being able to do either of the above would solve my problem.
Many thanks.
This discussion has been closed.
Replies
Also you can have the DataTables initialisation anywhere - as long as the DOM has loaded ($(document).ready() is one way, putting the scripts at the very end of the body is another).
Allan
For example, clicking the column header first time, sort asc, second time, desc, third time, revert to original.
Allan