Skip to content

Instantly share code, notes, and snippets.

@dagda1
Created November 14, 2011 21:28
Show Gist options
  • Save dagda1/1365243 to your computer and use it in GitHub Desktop.
Save dagda1/1365243 to your computer and use it in GitHub Desktop.
muview.coffee
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