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

Accessing Browserwindow(Parent Page) Control events from child RadWindow

2 Answers 404 Views
Window
This is a migrated thread and some comments may be shown as answers.
Noor hussain
Top achievements
Rank 1
Noor hussain asked on 30 Jun 2011, 08:17 AM
Hi,

Please let me know how to access the BrowserWindow (Parent Page ) control events from child RadWindow.
I have a RadMenu with two child menuitems and a radwindowmanager on my ParentPage.  On Click of first child radmenuitem I am opening a radwindow using the ParentPage RadWindowManager. Now in this Child radwindow I have a button, On this button click i want to simulate the RadMenuItem click event for the second child radmenuitem.  I m using the below javascript code to get the reference of the RadMenu of the Browser
var oRadMenu = GetRadWindow().BrowserWindow.document.getElementById('RadMenu1');
var item = oRadMenu.findItemByText(text);
Window (Parent Page)
, but I am unable to get the particular child radmenuitem. So that I can execute its click event. Any help is appreciated.

Regards,
Noor Hussain

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 01 Jul 2011, 12:08 PM
Hello Noor,

getElementById will return the HTML element while you need the control's object, that is usually accessed by $find(). Note however that because the menu is in the other page, it is best to create a function there that would "click" on the corresponding node. Once you have such function in the main page, you can simply call it from within the content one by using GetRadWindow().BrowserWindow.fnName().

For convenience I attached a small sample that illustrates the recommended approach - I hope this helps.


Best wishes,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Noor hussain
Top achievements
Rank 1
answered on 02 Jul 2011, 06:16 AM
Hello Georgi Tune,

Thanks a lot for your time and for the attached sample. It has solved my problem.

Regards,
Noor Hussain
Tags
Window
Asked by
Noor hussain
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Noor hussain
Top achievements
Rank 1
Share this question
or