-
-
Save gmurphey/fa1df0c6768eecfab80c to your computer and use it in GitHub Desktop.
Sorting select
This file contains 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 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: '3' | |
}, { | |
firstName: 'Tom', | |
rate: '20', | |
rating: '4' | |
}, { | |
firstName: 'Jack', | |
rate: '30', | |
rating: '5' | |
}]; | |
} | |
}); | |
This file contains 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": "2.4.3", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.4.3/ember-data.js", | |
"ember-template-compiler": "2.4.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment