This is a migrated thread and some comments may be shown as answers.

set windows behavior by JavaScript

3 Answers 114 Views
Window
This is a migrated thread and some comments may be shown as answers.
Shahid
Top achievements
Rank 1
Shahid asked on 18 Nov 2009, 02:30 PM
function openRadWindow(wndTitle, sParentID)
{
var oWnd = parent.window.radopen('Default.aspx?ID=' + sParentID + '&Title=' + wndTitle, null);
oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Reload + Telerik.Web.UI.WindowBehaviors.Close);
oWnd.SetSize(360, 400);
oWnd.MoveTo(300, 90);
return false; 
}

I am using the above javascript code for opening and setting the behaviour of radwindow.
I am able to get the object of Telerik.Web.UI although Telerik.Web.UI.WindowBehaviors comes out to be undefined. I have registered the Teleric.Web.UI dll in my application and is able to use successfully the other radControls.


3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 18 Nov 2009, 02:54 PM
Hi Shahid,

I believe that this forum thread will be of help:
http://www.telerik.com/community/forums/aspnet-ajax/window/set-behaviors-client-side.aspx



Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Shahid
Top achievements
Rank 1
answered on 19 Nov 2009, 12:57 PM
Thanks Georgi,

The Link you provided solved my above query.
I have one more question, I want to capture the OnWindowClose event on 'Default.aspx page' (The one I used in my above code). Can I do that.?
I am opening a radwindow from a parent page, and would like to get an alert through javascript function present on Default.aspx page when a user clicks on the Close button 'Cross' on the right corner of the radwindow.

Cureently I am able to capture the window close event on the parent page, becuase WindowManager is present there. Is there a way to capture this event on the page which is inside radwindow..?
0
Georgi Tunev
Telerik team
answered on 19 Nov 2009, 01:19 PM
Hello Shahid,

There is an OnBeforeClose event handler (add_beforeClose() / remove_beforeClose() client-side methods) that could be used for such purpose. Note that to avoid problems with the script execution, this function should be handled on the parent page, where the RadWindowManager is.


Sincerely yours,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Window
Asked by
Shahid
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Shahid
Top achievements
Rank 1
Share this question
or