RadComboBox - convert jQuery to telerik client object

2 posts, 0 answers
  1. Rama
    Rama avatar
    7 posts
    Member since:
    Jul 2014

    Posted 08 Dec 2016 Link to this post


    I have a RadPane which loads an aspx page that contains a RadComboBox.

    A Javascript function on the parent page is trying to find the element - 

    $('#RAD_SPLITTER_PANE_CONTENT_MyRadPane').contents().contents().find("#" + cbo.id)

    However, this returns just a jQuery object which is not useful when I want to manipulate the items using get_items() etc.

    How can I get the Telerik client object in this scenario?

    Thanks in advance.

  2. Ivan Danchev
    Ivan Danchev avatar
    2053 posts

    Posted 12 Dec 2016 Link to this post

    Hello Rama,

    If you have set your RadPane's ContentUrl property the aspx page will be loaded in an iframe. You can get the RadComboBox object through that iframe as shown below:
    var id = "RadComboBox1";
    var iframe = document.getElementById("RAD_SPLITTER_PANE_EXT_CONTENT_MyRadPane");
    var combo = document.getElementById("RAD_SPLITTER_PANE_EXT_CONTENT_MyRadPane").contentWindow.$find(id);

    id is hard-coded to "RadComboBox1" in the code snippet. If in your scenario you are saving the id in cbo.id you should use it instead: .$find(cbo.id)

    Ivan Danchev
    Telerik by Progress
    Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
Back to Top