Skip to content

Instantly share code, notes, and snippets.

@dagda1
Created November 13, 2011 18:58
Show Gist options
  • Save dagda1/1362495 to your computer and use it in GitHub Desktop.
Save dagda1/1362495 to your computer and use it in GitHub Desktop.
buview.coffee
class BusinessUnitsView extends MIBaseView
initialize: (options) ->
@vent = options.vent
options.vent.bind('showBusinessUnits', @showBusinessUnits)
events:
'click #generate': "generate"
generate: (e) =>
e.preventDefault()
businessUnits = _.map( $('input:checked'), (check) ->
{Uid: $(check).val(), Title: $(check).parents("tr:eq(0)").find("label").html()}
)
if businessUnits .length == 0
showErrorMessage('You have not selected any businss units.')
return
@vent.trigger('reportbusinessunitview:load', new BusinessUnits(identifiers))
self = @
@el.slideUp('slow', ->(
self.vent.trigger('showBuBreakDown')
)
)
showBusinessUnits: =>
@el.slideDown('slow')
@vent.trigger('reportbusinessunitview:load', new BusinessUnits(identifiers))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment