Skip to content

Instantly share code, notes, and snippets.

@erichocean
Created January 20, 2011 18:56
Show Gist options
  • Save erichocean/788385 to your computer and use it in GitHub Desktop.
Save erichocean/788385 to your computer and use it in GitHub Desktop.
How to transform the status property of a content object for use by a view.
valueBinding: SC.Binding.transform(function(value, binding) {
if (value === SC.Record.READY_DIRTY ||
value === SC.Record.READY_NEW) {
return YES;
} else return NO;
}).from('Todos.taskController.status')
@mauritslamers
Copy link

    valueBinding: SC.Binding.transform(function(value,binding){
      if (value === "") return "Categories";
      else return value;
    }).from('Rollbook.categoryController.name');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment