views:

198

answers:

2

I was looking for cascaded (multi-level) dialogs in DOJO Toolkit. I understand that a proper implementation of this will be available in DOJO 1.4. (http://stackoverflow.com/questions/809350/dojo-dialog-nesting)

I was wondering if a basic functionality of it (for managing the zIndexes) could be done easily by sub-classing the existing dijit.Dialog (1.3) class. If somebody can show a basic outline of how this can be done, it would be great.

+1  A: 

The way Dojo 1.4 does this is basically keeping a stack of all open dialogs in a global namespace and moving the z-index of the dialog underlay when opening the next dialog. You can use the code repository located at http://bugs.dojotoolkit.org/browser/dijit/trunk/Dialog.js to see the changes made to get it working.

Joscha
Thanx I had tried to put this in my 1.3 installation. But it raised javascript errors for a missing html file (which I guess was the template for Dialog class: templates/Dialog.html). Probably its not so easy to place a source code file directly in the Shrink-safe distribution of DOJO. At this point I gave up and later put up this question on Stack Overflow.
Shailesh Kumar
Yes, shrinksafe will inline the templates to save requests. That means that a template defined via templatePath will become inlined in templateString on using shrinksafe. Thats why you would either need to override templateString or set templateString to empty and put templatePath: dojo.moduleUrl("some.module","/templates/MyTemplate.html") into your subclass.
Joscha