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

How to get reference to RadComboBox with JQuery in different page

2 Answers 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 05 Dec 2018, 03:45 PM

I need to access a RadComboBox that is defined in one .ascx file from a different .ascx file so that I can get/set values in it.  I've read this information https://docs.telerik.com/devtools/aspnet-ajax/general-information/get-client-side-reference#using-jquery-selectors but it isn't working.  All help is greatly appreciated.  Here are the details about what I have:

 

In View.ascx the control is specified:

<telerik:RadComboBox RenderMode="Lightweight" ID="cmbReportTool" filter="Contains" runat="server"
         oWrap="false" class="cmb-report-tool"  CheckBoxes="true" EnableCheckAllItemsCheckBox="true" width="400px">
</telerik:RadComboBox>

and the following JavaScript exists in a different .ascx file:

function () {

    var combo = $telerik.$("[id$='cmbReportTool']").get(0).control;

}

I've played around with the JS and used an alert() to quickly see what I have.  The following code presents "combo: [object HTMLDivElement]"

function () {
    var combo = $telerik.$("[id$='cmbReportTool']").get(0);

alert('combo: ' + combo);
}

 

The following code presents "combo: undefined"

function () {
    var combo = $telerik.$("[id$='cmbReportTool']").get(0).control;
alert('combo: ' + combo);
}

 

Here are some specifics about my environment:

OS: Windows 7 Enterprise with service pack 1
Browser: Internet Explorer 11
Telerik Web UI version 2016.3.1027.40

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 10 Dec 2018, 12:47 PM
Hello Matthew,

Please find attached a video demonstrating how to inspect the rendered HTML by the control, how to obtain the ID and use it in order to get reference to the control regardless of whether it is accessed from an aspx/ascx or another page.

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Matthew
Top achievements
Rank 1
answered on 31 Dec 2018, 01:11 AM
Thank you for your help.
Tags
General Discussions
Asked by
Matthew
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Matthew
Top achievements
Rank 1
Share this question
or