Skip to content

Instantly share code, notes, and snippets.

@ungoldman
Created July 26, 2013 17:58
Show Gist options
  • Select an option

  • Save ungoldman/6090871 to your computer and use it in GitHub Desktop.

Select an option

Save ungoldman/6090871 to your computer and use it in GitHub Desktop.
bind marionette view to model changes
Views.ListItem = Marionette.ItemView.extend({
template: 'item',
tagName: 'li',
className: 'gt-result',
initialize: function() {
// THIS
this.listenTo(this.model, 'change', this.render);
this.listenTo(this.model, 'change', this.renderShape);
},
onShow: function() {
App.listDrawerRegion.$el.find('.gt-list-header').removeClass('gt-hide');
this.renderShape();
},
renderShape: function() {
console.log('sup');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment