javascript - Ember - sort array by multiple properties in multiple directions -
i need sort collection of ember models multiple properties, , not necessary in same direction/order. i.e. need sort property a in ascending order , property b in descending. there way accomplish this?
updatei tried setting sortascending
property array, not working. after looking source seems functionality not supported out of box(yet).
in arraycontroller:
sortproperties: ["propa:asc", "propb:desc"] sortedmodel: ember.computed.sort("model", "sortproperties");
then reference sortedmodel
in template's #each
handler.
javascript sorting ember.js
No comments:
Post a Comment