Close all modal dialogs in Dojo

Does anyone know how I can close all modal dialogs created by Dojo? Apparently, the dojo.popup.closeAll function used to exist, but it is no longer available in the latest version of the Dojo API that ships with Spring JS.

+3
source share
5 answers

That's right ... the reason this method no longer exists is because from 1.0, who opens the popup is responsible for closing it. This is the architecture change I made.

Most widgets (such as Menus) control when they are blurred, and then close the pop-up window. Thus, you could get the desired effect by switching the focus to the document itself or to a random node. Of course, a workaround.

Bill

+3
source

This will find all literal dialogs on the page and hide them:

dijit.registry.filter(function(w){ return w && w.declaredClass == "dijit.Dialog" }).forEach(function(w){ w.hide(); }); 
+3
source

It seems like the only right way is to keep an eye on your dialogs and close them when needed with hide ().

+1
source

I do not know how useful this is, but I try to use only one dialog box for each page (since it is modal). The entire contents of the dialogs is xhrGot from the server, and I spend the entire dojo -time over the life cycle of the page again and again in the same dialog, simply changing its attributes: its href and its title . I believe this works, as well as a few dialogs.

0
source

dojo> = 1.10:

 define(['dijit/registry'], ... registery.toArray().filter(function(w){ return w && w.declaredClass == "dijit.Dialog" }).forEach(function(w){ w.hide(); }); 
0
source

All Articles