Created
November 14, 2011 21:28
-
-
Save dagda1/1365243 to your computer and use it in GitHub Desktop.
muview.coffee
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 ManagementReportView extends MIBaseView | |
initialize: (options) -> | |
options.vent.bind("reportbusinessunitview:unload", @onClose) | |
options.vent.bind("reportbusinessunitview:load", @load) | |
@vent = options.vent | |
load: (businessUnits) => | |
@collection = businessUnits | |
@collection.bind 'reset', @render | |
@collection.fetch() | |
onClose: => | |
@collection.unbind('reset') if @collection | |
@disposeViews() | |
render: => | |
self = @ | |
@collection.each (item, counter) -> | |
self.renderView(self.el, 'append', new ReportBusinessUnitView(model: item, vent: self.vent)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment