Convert an basic element in rad control

2 posts, 1 answers
  1. Pierre-Antoine DOUCHET
    Pierre-Antoine DOUCHET avatar
    11 posts
    Member since:
    Oct 2009

    Posted 16 Oct 2009 Link to this post


    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.
  2. Answer
    Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 16 Oct 2009 Link to this post

    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");

    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.
Back to Top