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

Reload RadComboBox on changing of other asp form elements

5 Answers 466 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Conor
Top achievements
Rank 1
Conor asked on 24 Nov 2014, 01:19 PM
I'm trying to get a RadComboBox to reload when any of 5 .asp form elements in the page are changed.

For example, I have an asp textbox calender, which, if changed, I want to trigger a reload of a RadComboBox as a change of date changes availability of the options in the combobox.

Is there a simple way of doing this using, say the "onchange" function in the asp form element? Any assistance on the simplest method to achieve this would be welcome.

Thanks in advance.

5 Answers, 1 is accepted

Sort by
0
Conor
Top achievements
Rank 1
answered on 24 Nov 2014, 02:49 PM
In case it makes a difference, this RCB is being populated by a web service.
0
Boyan Dimitrov
Telerik team
answered on 27 Nov 2014, 11:21 AM
Hello,

I would like to clarify that the change event is fired for <input>, <select>, and <textarea> elements when a change to the element's value is committed by the user.

In this case I would suggest subscribing for each control's client event that is fired when user interaction with the control occurs and request the RadComboBox items. You can do that by calling the RadComboBox client-side object requestItems method as explained in this help article.

Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Conor
Top achievements
Rank 1
answered on 28 Nov 2014, 09:52 AM
Thanks for the reply.

I've implemented an onchange function in the asp form elements to call a function when the field is changed, I'm just having difficulty getting the function that fires a reload of the RCB to work.

If my RCB is called myRadComboBox - what do I need to do to this?

<script language="javascript" type="text/javascript">
 function myReloadFunction() {
     var combo = $find(myRadComboBox);
     combo.requestItems();
 }
 </script>

Thanks!
0
Boyan Dimitrov
Telerik team
answered on 03 Dec 2014, 09:50 AM
Hello,

You can pass an empty string in order to request all items from the web service.
//code
combo.requestItems("", true);


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Conor
Top achievements
Rank 1
answered on 03 Dec 2014, 10:00 AM
Many thanks, Boyan.

I actually got it working last night - using the empty string you've just suggested.

Conor
Tags
ComboBox
Asked by
Conor
Top achievements
Rank 1
Answers by
Conor
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Share this question
or