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

how change the radcombobox value from external Js file using jquery

2 Answers 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
sai
Top achievements
Rank 1
sai asked on 07 Feb 2020, 09:55 AM

Hi,

I have aspx file which refer another external jquery file.i.e. js file referred in aspx page.in this page we migration the old control into new telerik control.After selecting in autocomplete, they send a jquery ajax call for get data from the service and  rendering in respective control instead of typing.All this functionality is available in external js file.So how i can get the Radcombobox and change the value.Any suggestion on this. please Support me.

 

Thank you

S A Saikrisshnan

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Peter Milchev
Telerik team
answered on 11 Feb 2020, 08:09 AM

Hello Sai,

As the server tags that are needed for evaluating the client id of the controls are not supported in external files, you would need to save the id of the control as a global variable accessible in the external file. An example is showed in this demo:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            var radWindow1 = null;
            var radGrid1 = null;
            var panelStep1 = null;
            var panelStep2 = null;
 
            function pageLoadHandler() {
                radGrid1 = $find("<%= RadGrid1.ClientID %>");
                radWindow1 = $find("<%= RadWindow1.ClientID %>");
                panelStep1 = $get("<%= FirstStepPanel.ClientID %>");
                panelStep2 = $get("<%= SecondStepPanel.ClientID %>");
            }
            Sys.Application.add_load(pageLoadHandler); 
        </script>
    </telerik:RadCodeBlock>

function bookNowCloseClicking(sender, args) {
    radWindow1.close();
    togglePanels();
    radGrid1.get_masterTableView().fireCommand("UpdateCount", radWindow1.get_title());
    args.set_cancel(true);
}

Another approach is to use one of the other ways to access a client-side object, for example with DOM traversal and jQuery :

Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
sai
Top achievements
Rank 1
answered on 13 Feb 2020, 05:33 AM
Thank you it works fine for me
Tags
General Discussions
Asked by
sai
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
sai
Top achievements
Rank 1
Share this question
or