Created
September 7, 2011 05:42
-
-
Save jdkealy/1199856 to your computer and use it in GitHub Desktop.
This file contains 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
NewDate.Views.Profiles ||= {} | |
class NewDate.Views.Profiles.IndexView extends Backbone.View | |
template: JST["backbone/templates/profiles/index"] | |
‣‣‣‣ | |
initialize: () -> | |
_.bindAll(this, 'addOne', 'addAll', 'render'); | |
‣‣‣‣ | |
@options.profiles.bind('reset', this.addAll); | |
‣‣‣ | |
addAll: () -> | |
@options.profiles.each(this.addOne) | |
‣‣ | |
addOne: (profile) -> | |
view = new NewDate.Views.Profiles.ProfileView({model : profile}) | |
this.$("tbody").append(view.render().el) | |
‣‣‣‣‣‣‣ | |
render: -> | |
$(this.el).html(this.template(profiles: this.options.profiles.toJSON() )) | |
@addAll() | |
‣‣‣‣ | |
return this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment