View Full Version : Dialog opens an Dialog
olimlad
16 Nov 2007, 5:25 AM
Hello,
is it possible that an dialog opens an other dialog? for example the main dialog loads as content an url with a button which opens also a dialog.
thx
Oli
tryanDLS
16 Nov 2007, 8:08 AM
Short answer - Yes. Have you tried?
olimlad
19 Nov 2007, 12:40 AM
yes i tried it :)
the problem is that the "child dialog"-div must not be in the div of the parent child, is this correct?
for example:
<div id="parentDialog">
<!-- loaded after parentDialog is called -->
<div id="childDialog">
</div>
</div>
if i build an example like the example, the child dialog appears in the parent dialog... and not over my hole page. The div tag "childDialog" is rendered after the parentdialog is loaded. Is it possible to render the elements like in the example and use many dialogs over dialogs?
i hope someone has understood my problem :)
thx
rouvas
19 Nov 2007, 2:14 AM
place each dialog you wish to open in a div directly after the document.body element and all is well.
Example:
<body>
...content...
<div id=dialog1>.....</div>
<div id=dialog2>... maybe called after dialog1 is displayed, maybe not...</div>
<div id=dialog3> ... </div>
etc
</body>
olimlad
19 Nov 2007, 2:51 AM
hmm ok i know what you mean :) but my problem is that i loads into my parent dialog a new dialog. the div of my child-dialog is not existing in the body only in the loaded div of my parentdialog.
an example:
<body>
...
<div id="parentDialog1">
<!-- loading content for dialog -->
</div>
...
</body>
content for parentDialog1:
<input type="button" onclick="ShowDialog('content.html')" name="opendialog" value="open dialog"/>
<div id="childDialog">
<!-- loading content.html -->
</div>
is this possible? i want to integrate extjs into .net that is the reason why i want to set a dialog-div into the loaded dialog.
rouvas
19 Nov 2007, 3:13 AM
The way I see it, you have two options:
(1) Find a way to load the childDialog outside the parentDialog
(2) Use the following code after loading but *before* showing parentDialog:
var origNode = document.getElementById('childDialog');
var copied = origNode.cloneNode(true);
if (origNode.parentNode) origNode.parentNode.removeChild(origNode);
document.body.appendChild(copied);
The preferrable way is the option No.1
Option No.2 has been tested on FF and IE but not on Opera.
-Stathis
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.