[Dojo-interest] dijit.Dialog - how to suppress submit method and stay in the dialog window

Nick Fenwick neek at nickfenwick.com
Wed Jun 30 22:55:30 EDT 2010


On 07/01/2010 03:40 AM, Christopher Barrett wrote:
> dojo.connect(submitButton, "onClick", function(event) {
> event.preventDefault();  event.stopPropagation(); });
>    

Or slightly simpler:

dojo.stopEvent(event);

See dojo/_base/event.js:

         dojo.stopEvent = function(/*Event*/ evt){
                 // summary:
                 //              prevents propagation and clobbers the 
default ac
tion of the
                 //              passed event
                 // evt: Event
                 //              The event object. If omitted, 
window.event is us
ed on IE.
                 evt.preventDefault();
                 evt.stopPropagation();
                 // NOTE: below, this method is overridden for IE
         }

with more magic later for IE.

Nick


More information about the Dojo-interest mailing list