I am building table from a model property which has hasMany relation to another model. I wanted to implement sorting functionality so that when the user clicks on the column header, the underlying mode data gets sorted based on what that column is mapped to in underlying model but I couldn't get things working. I jave a jsfiddle of what I tried : http://jsfiddle.net/CMe28/4/
I have a property defined on controller like:
analyticsRunParameters: (function() {
var sortColumn = this.get('sortColumn');
return Ember.ArrayProxy.createWithMixins(Ember.SortableMixin, {
sortProperties: [sortColumn],
//sortAscending: true,
content: this.get('content.analyticsRunParameters')
});
}).property('content.analyticsRunParameters')
This works for initial loading, but I have no clew as to how to update the column by which I want to sort the data later. It seem like the solution out there works for arraycontroller, but my main controller is ObjectController. Please advise on what can be done to implement sorting in such case.
Thanks, Dee