I would like to show a modal window over another modal window.
I first tried to apply this doc but second window is not modal from first.
Can you add a "multi-modal window" behavior ? When second is shown as modal from first window, first widows is hidden (not closed) and when second window is close, first window is shown (and not reloaded as if "opened").
Thanks.
9 Answers, 1 is accepted
Here is the code that I tried to show modal window over another modal window. Give a try with this.
Parent Page (Default.aspx):
aspx:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
<Windows> |
<telerik:RadWindow Modal="true" Width="600" Height="450" runat="server" ID="Win1" |
NavigateUrl="win1.aspx" OpenerElementID="Button1"> |
</telerik:RadWindow> |
</Windows> |
</telerik:RadWindowManager> |
<input id="Button1" type="button" value="Oepn Window"/> |
Page opened in RadWindow1 (win1.aspx) :
aspx:
<input id="Button3" type="button" value="Open another window" onclick="openwin();" /> |
javascript:
<script type="text/javascript"> |
function openwin() |
{ |
var oBrowserWnd = GetRadWindow().BrowserWindow; |
var oWnd = oBrowserWnd.radopen("win2.aspx", "NewWindow"); |
oWnd.set_modal(true); |
} |
</script> |
Thanks,
Princy.
Yes this scenario is possible, but you need to call the set_modal() function of the second RadWindow after some timeout :
function openPopup() |
{ |
var oWindow = GetRadWindow(); |
var newWindow = oWindow.BrowserWindow.radopen('http://www.telerik.com', 'RadWindowB'); |
setTimeout |
( |
function() |
{ |
newWindow.set_modal(true); |
}, |
0); |
} |
As you can see the zero duration does the trick as the well. For your convenience I have attached a full demo to the thread.
I hope this helps.
Kind regards,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
- Run the application
- Click on the button "Show radWindow 1", this open the firts window
- Maximaze the firts window (radWindow 1 = PopUp1.aspx)
- Click on the button "Show radWindow 2", this open the second window behind the first
It looks like the problem appears when a window is "Maximazed"
I really need to solve this issue its urgent, any idea?
Thanks in advance for your reply.
This scenario is not supported by the RadWindow control, because the modal and the maximized RadWindow is expected to be on the top of all the elements on the page. However, it can be achieved using the RadWindow's client-side API. For your convenience, I prepared a sample project that demonstrates how to implement the desired functionality. The idea is, when the second window is shown and the first one is maximized - you simply restore the first one; then in the OnClientClose event handler of the second window you maximize the first window.
Best wishes,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thank you very much Fiko, the solution was great and works perfectly.
I was trying with the methods setActive() and set_modal() of the window but they didn't work, the one that help me, was the
restore() method.
I did the following
- Every time I open a window I check if it's maximazed, if it's true, I restored them
var oManager = GetRadWindowManager();
var activeWindow = oManager.GetActiveWindow(); // Get reference to the active RadWindow;
if(activeWindow != null && activeWindow.isMaximized())
{
activeWindow.restore();
maximazeActiveWindow =
true;
}
var newWindow = window.radopen(url, '');
2. When I come back to the first window I did the following
var oManager = GetRadWindowManager();
var activeWindow = oManager.GetActiveWindow(); // Get reference to the active RadWindow;
if(maximazeActiveWindow)
{
oWnd.maximize();
maximazeActiveWindow = false;
}
Thanks,
Ivan
I have already answered your question in this forum thread.
Best wishes,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Regards
Sreenivas.
Thanks a lot, Fiko..
It worked for me..