user1141827
user1141827

Reputation: 65

Rally find query & ordering fields

Two questions somewhat related to each other:

In a "find" / "findAll" query, is it possible to order by multiple fields, e.g.

rallyDataSource.find( ... , 'order': 'ScheduleState, Rank', ...)

such that it will order primarily by ScheduleState, but then by Rank? (I tried it, but couldn't get it to work - it seemed to only use the first field).

Also, with the example of doing a find query ordered by ScheduleState, it looks like the results are ordered according to the index / progress of the state (i.e. "Defined, then "In-Progress", and so on, and not alphabetically). Is this observation / assumption correct? (I'm working on a display that will be made simpler by utilizing this assumption)

Thanks!

Upvotes: 1

Views: 1827

Answers (1)

Kyle Morse
Kyle Morse

Reputation: 8410

You should be able to sort by multiple fields...

order: 'Name DESC,Rank DESC'

And yes- ordering by a dropdown field should return the results in the order in which the dropdown items are defined.

Upvotes: 3

Related Questions