The above image is of observableArray which is coming while queryinq database using breezeJS (using EntityManager).
My question is that
how do we sort this observable based on some criteria i.e., (object.attributeName) ?
So that this array is sorted based on some attribute name and we can simply use the observable within foreach bindings and use them in sorted way because I don't wanna query all the time (locally or from server) to get data in sorted order.
So make a computed
so to change to a sort by
name
descending, you simply change:and your computed dependent
orderedObsArr
will be updated.See this pen for a working example.