Last active
March 27, 2016 01:11
-
-
Save herzzanu/1a27f6cd74469108f0b3 to your computer and use it in GitHub Desktop.
Sorting select
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
queryParams: ['sort'], | |
sort: "", | |
sortedUsers: Ember.computed.sort('model', 'sortDefinition'), | |
sortDefinition: Ember.computed('sort', function() { | |
return [ this.get('sort') ]; | |
}), | |
sortingOptions: [ | |
{ | |
displayValue: 'Hourly Rate', | |
value: 'rate' | |
}, | |
{ | |
displayValue: 'User Rating', | |
value: 'rating' | |
} | |
] | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function() { | |
return [{ | |
firstName: 'John', | |
rate: '10', | |
rating: '5' | |
}, { | |
firstName: 'Tom', | |
rate: '20', | |
rating: '3' | |
}, { | |
firstName: 'Jack', | |
rate: '30', | |
rating: '4' | |
}]; | |
} | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.7.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "1.13.13", | |
"ember-data": "1.13.15", | |
"ember-template-compiler": "1.13.13" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment