Author Topic: How to sort by multiple columns with sorting = "local"?  (Read 5614 times)

nghiemhd

  • Newbie
  • *
  • Posts: 16
    • View Profile
How to sort by multiple columns with sorting = "local"?
« on: September 23, 2013, 10:01:21 am »
Hi everyone,

I have a json data with these fields: EmployeeId, Name, DOB, Title
I want to sort data in client and by multiple columns (with order by sortedColumn, DOB, EmployeeId)
For example:
If sort by Name, data will order by Name, DOB, EmployeeId
If sort by Title, data will order by Title, DOB, EmployeeId
If sort by DOB, data will order by DOB, EmployeeId

How can I do this? Thank you very much



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: How to sort by multiple columns with sorting = "local"?
« Reply #1 on: September 23, 2013, 02:07:13 pm »
There is inbuilt support for multiple column sorting in Pro version.

http://paramquery.com/pro/api#option-dataModel-sortIndx


In base version you have to implement multiple column sorting yourself by listening to beforeSort event and returning false.

http://paramquery.com/api#event-beforeSort

« Last Edit: September 23, 2013, 03:08:32 pm by paramquery »