Created
August 24, 2010 16:30
-
-
Save jbueza/547842 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
//assign an observer to the submit button of the ajax form | |
this.addObserver("#btn-submit", "onclick", "Submit"); | |
//only if we're passed validation, we show the overlay to display a request indicator | |
this.addObserver(this.getCommand("ValidateRules"), "onResponse", "ShowOverlay", { show: true }); | |
// | |
this.addObserver(this.getCommand("Submit"), "onComplete", "ShowOverlay", { show: false }); | |
//addintercepts | |
this.addIntercept("around", "Submit", "ValidateRules", {}); | |
// command sequence: | |
// user clicks submit button -> validate the form -> if validation passes, show overlay -> hide overlay onComplete of submission |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment