Skip to content

Instantly share code, notes, and snippets.

@topherfangio
Created August 25, 2011 21:11
Show Gist options
  • Save topherfangio/1171977 to your computer and use it in GitHub Desktop.
Save topherfangio/1171977 to your computer and use it in GitHub Desktop.
Quick example of how to use SC.TemplateCollection ItemViews
{{#collection MyApp.ExampleCollectionView contentBinding="MyApp.myController.content"}}
{{view MyApp.MyButton class='mini right'}}
{{/collection}}
MyApp.ExampleCollectionView = SC.TemplateCollectionView.extend({
});
MyApp.MyButtonView = SC.Button.extend({
mouseDown: function(evt) {
var id = this.getPath('parentView.content.id');
MyApp.myController.sendAction('showDetail', id);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment