Skip to content

Instantly share code, notes, and snippets.

@tritchey
Created July 22, 2011 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tritchey/1099938 to your computer and use it in GitHub Desktop.
Save tritchey/1099938 to your computer and use it in GitHub Desktop.
filtering
ScaleUI.taskTagController = SC.ArrayController.create(
/** @scope ScaleUI.taskTagController.prototype */ {
queuedTasks: function() {
var content = this.get('content');
if(!SC.none(content)) {
return content.filterProperty('state', TaskState.QUEUED);
}
}.property('@each.state').cacheable(),
runningTasks: function() {
var content = this.get('content');
if(!SC.none(content)) {
return content.filterProperty('state', TaskState.RUNNING);
}
}.property('@each.state').cacheable(),
completeTasks: function() {
var content = this.get('content');
if(!SC.none(content)) {
return content.filterProperty('state', TaskState.COMPLETE);
}
}.property('@each.state').cacheable(),
errorTasks: function() {
var content = this.get('content');
if(!SC.none(content)) {
return content.filterProperty('state', TaskState.ERROR);
}
}.property('@each.state').cacheable()
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment