How to open RadWindow from another RadWindow.
Scenario:
You have parent Window A and from it you have opened Modal Window[Child window] B..which is quite simple using radopen method…
But now you want to open Window C as a Modal Window [Child window]from Window B…using RADWINDOW Control. Sounds interesting na?? Let’s see how to achieve it?
Solution:
For your simplicity I have created one function which will do this for you and function is self explanatory..so you can gauge what it is doing..
Here is the JS Function for it
//This function will act as a common function
//for opening up a RadEditor window
//PageToOpen = Retlative path of page of page which you want to open
//windowToOpen=name of RadWindow which you want to open it nothing pass NULL
function ShowModalFromModalWindow(PageToOpen,windowToOpen)
{
//Get the Applicationpath
var rootURL='<%=Request.ApplicationPath%>’
//manipulate URL
var CompleteURL = rootURL+PageToOpen;
//Get window manager
var aWindowManager = GetRadWindow().GetWindowManager();
var oradPopupWindow = aWindowManager.Open(CompleteURL,windowToOpen);
oradPopupWindow.Show(); //To Open Popup in Modal
//For opening a child window under the child window as a modal and active window
window.setTimeout(function()
{
oradPopupWindow.setActive(true);
oradPopupWindow.SetModal(true);
oradPopupWindow.center();
//Set Size Width,Height
oradPopupWindow.setSize(“405″,”280”);
},0);
return false;
}
Use of it.
<asp:Button ID=”btnChildOpen” runat=”server” Text=”Open” onClientClick=”return ShowModalFromModalWindow(‘http://www.google.com’,’myradWindow’);”
That’s it!!!
Leave a Reply