2 Answers, 1 is accepted
function
OpenWindow(navigateURL, radWindow, Width, Height) {
var parentPage = GetRadWindow().BrowserWindow;
var parentRadWindowManager = parentPage.GetRadWindowManager();
var oWnd = parentRadWindowManager.open(navigateURL, radWindow);
oWnd.setSize(Width, Height);
oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close);
//oWnd.show();
}
I have tried with an dwithout the call to show.
Hi Andrew,
I am not sure about the setup that you tried. I guess you are trying to set the behaviors of the second RadWindow from the already opened RadWindow, because the client side code you posted is working fine in that case (I have added RadWindowManager in the page that is opened in the first RadWindow and also added the GetRadWindow() method).
ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
</telerik:RadWindowManager> |
<input id="Button2" type="button" value="OpenWindow" onclick="OpenWindow();"/> |
JavaScript:
<script type="text/javascript"> |
function GetRadWindow() |
{ |
var oWindow = null; |
if (window.radWindow) |
oWindow = window.radWindow; |
else if (window.frameElement.radWindow) |
oWindow = window.frameElement.radWindow; |
return oWindow; |
} |
function OpenWindow(navigateURL, radWindow, Width, Height) |
{ |
var parentPage = GetRadWindow().BrowserWindow; |
var parentRadWindowManager = parentPage.GetRadWindowManager(); |
var oWnd = parentRadWindowManager.open('http://www.google.com', 'window2'); |
oWnd.setSize(300, 250); |
oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close); |
} |
</script> |
If you are using a single RadWindow and want to set the behaviors while showing the window, then you can set the behaviors like this.
JavaScript:
<script type="text/javascript"> |
function OpenWindow(navigateURL, radWindow, Width, Height) |
{ |
var oWnd = window.radopen('http://www.google.com', 'window2'); |
oWnd.setSize(300, 250); |
oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close); |
} |
</script> |
Thanks,
Princy.