bk11425
bk11425

Reputation: 334

Sort ArrayController multiple columns and directions

Is it possible to sort the content of an ArrayController by both multiple fields and multiple directions? Would this work, trying a sort like "lastName ASC, zip DESC":

App.TableController = Ember.ArrayController.extend({
  sortProperties: ['lastName', 'zip'],
  sortAscending: [true, false]
})

I searched posts here and through the Ember docs but couldn't find any information on multiple 'sortAscending' options.

Bryan

Upvotes: 0

Views: 43

Answers (1)

GJK
GJK

Reputation: 37379

Unfortunately, it's not possible, as noted by this discussion. You'd have to write your own sorting function to do it.

Upvotes: 1

Related Questions