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

Convert an basic element in rad control

1 Answer 73 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Pierre-Antoine DOUCHET
Top achievements
Rank 1
Pierre-Antoine DOUCHET asked on 16 Oct 2009, 01:22 PM
Hello,

I've got a problem with a client-side program.

I have 3 iframes in my website and I want to get a radtoolbar object to detect the button clicked.
This object is in the iframe 1 and I want it back in the iframe 2. Here is the code to retrieve:

var toolbar = parent.frames["HeaderFrame"].document.getElementById("ToolBarMenu"); 
for(i=0; i<toolbar.get_items().get_count(); i++) 
        alert(toolbar.get_items().getItem(i).get_text()); // to see if the toolbar is really a radtoolbar aobject
}

My browser gets an error (toolbar.get_items is not a function.
With this method, i retrieve a [object HTMLDivElement].

How can i get a real radtoolbar object or how can I convert this [object HTMLDivElement] in radtoolbar object ?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 16 Oct 2009, 01:47 PM
Hello Pierre-Antoine DOUCHET,

You should use the $find() method to get a reference to the client-side object representing RadToolBar. It gets a bit complicated with frames but it is still possible. Here is how the code should look like:

var toolbar = parent.frames["HeaderFrame"].$find("ToolBarMenu");

Regards,
Albert,
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
ToolBar
Asked by
Pierre-Antoine DOUCHET
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or