Created
June 14, 2012 16:49
-
-
Save esmevane/2931439 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
class Example.Views.Table extends Backbone.View | |
template: JST['example/table'] | |
initialize: -> | |
_.bindAll @, 'addOne', 'addAll' | |
@collection.on 'add', @addOne | |
render: -> | |
@$el.html @template() | |
@addAll() | |
@ | |
addOne: (person) -> | |
view = new Example.Views.Row model: person | |
@$el.append view.render().el | |
addAll: -> @collection.each (person) => @addOne person |
This file contains hidden or 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
class Example.Views.Row extends Backbone.View | |
template: JST['example/row'] | |
render: -> | |
@$el.html @template @model | |
@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment