getSortOrder?

getSortOrder?

mahemoffmahemoff Posts: 2Questions: 0Answers: 0
edited March 2010 in General
Hi, Is there any way to get the current sort order? I see there's a fnSortListener, but it doesn't really do what I expected, ie notify each time sort order changes. (And in any event, I just want to make a query, not find out every time it's changed.)

Thanks.

Replies

  • ajoslin103ajoslin103 Posts: 20Questions: 4Answers: 0
    looping aiMasterDisplay to index into aoData to get the items back in sorted order
    (looping with aiDisplay will return the filtered sorted set)
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You can use oTable.fnSettings().aaSorting - which is the array where DataTables keeps the sorting information. If you wanted to know when the sorting had changed, you can use fnDrawCallback and check what oSettings.bSorted is (true if sorted on that draw, false if not).

    Allan
This discussion has been closed.