Created
May 29, 2014 15:55
-
-
Save mjc/70f55f44586bf3eb4105 to your computer and use it in GitHub Desktop.
Sortable example for ember.js
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
WidgetsController = Ember.ArrayController.extend | |
sortProperties: ["user.firstName"] | |
sortAscending: true | |
actions: | |
sortBy: (sortProperties) -> | |
old = @get("sortProperties") | |
@set "sortProperties", [sortProperties] | |
@toggleProperty "sortAscending" if sortProperties in old | |
return false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment