How to find out what column the user sorted on...

How to find out what column the user sorted on...

ravishbhagdevravishbhagdev Posts: 4Questions: 0Answers: 0
edited November 2012 in DataTables 1.9
I understand that I can capture the sort event as described here: http://datatables.net/forums/discussion/2976/sort-callback/p1

I am trying to capture this event, find out what the user sorted on and save it in a cookie. I know I can use bStateSave for saving the state automatically but I can't use it as iDeferLoading is not supported along with it (http://datatables.net/forums/discussion/comment/41588) . I'd like to manually save cookie when sort happens and specify its value in aaSorting when the page is loaded.

I'll appreciate help with this.

Replies

  • allanallan Posts: 63,394Questions: 1Answers: 10,450 Site admin
    Current you can use `table.fnSettings().aaSorting` to get the sorting array. Don't set that array, just read from it. It is considered an internal property so it may change between major versions. DataTables 1.10 is going to include a new public API to get this information.

    Allan
This discussion has been closed.