Created
November 13, 2011 18:58
-
-
Save dagda1/1362495 to your computer and use it in GitHub Desktop.
buview.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 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