Hi
I have a scenario where the selection made in combo1 must update the combo2 and combo3. The multiple combo example provided in this website was useful to some extent. But I am not able to come up with the Javascript part that takes care of updating the combo2 and combo3 when combo1 is selected.
I tried to make use of this piece of code from another thread but it is not helping me. This piece of code was used for dynamically created Radcomboboxes.
When I use the above code I am getting a Javascript error saying 'buildform' is undefined.
Here is the HtML part:
Pls help me to come up with the code.
Thanks
I have a scenario where the selection made in combo1 must update the combo2 and combo3. The multiple combo example provided in this website was useful to some extent. But I am not able to come up with the Javascript part that takes care of updating the combo2 and combo3 when combo1 is selected.
I tried to make use of this piece of code from another thread but it is not helping me. This piece of code was used for dynamically created Radcomboboxes.
| <script> |
| function goLoadCountries(combo, eventArqs) |
| { |
| var item = eventArqs.get_item(); |
| var prompt; |
| combo.tempVal = item.get_value(); |
| for (i = 0; i < Telerik.Web.UI.RadComboBox.ComboBoxes.length; i++) { |
| prompt = Telerik.Web.UI.RadComboBox.ComboBoxes[i]; |
| if (prompt.get_attributes().getAttribute("parent") == combo.get_id()) { |
| prompt.set_text("Loading..."); |
| prompt.requestItems(item.get_value(), false); |
| } |
| } |
| } |
| function ItemsLoaded(combo, eventArgs) { |
| if (combo.get_items().get_count() > 0) |
| { |
| combo.get_inputDomElement().className = "rcbInput"; |
| var item = combo.get_items().getItem(0); |
| item.select(); |
| } |
| } |
| function buildForm(sender, eventArgs){ |
| var context = eventArgs.get_context(); |
| for (i=0; i<Telerik.Web.UI.RadComboBox.ComboBoxes.length; i++){ |
| context[Telerik.Web.UI.RadComboBox.ComboBoxes[i].get_id()] = Telerik.Web.UI.RadComboBox.ComboBoxes[i].tempVal; |
| } |
| } |
| </script> |
Here is the HtML part:
| <td>Location:</td> |
| <td><telerik:RadComboBox ID="cbLocation" runat="server" Skin="Black" SelectedValue='<%# DataBinder.Eval( Container, "DataItem.locationName") %>' |
| EmptyMessage=" Select Location" HighlightTemplatedItems="True" DataTextField="name" EnableLoadOnDemand="true" |
| DataValueField="locationId" EnableTextSelection="False" DataSourceID="SqlDataSource_Loc" |
| AppendDataBoundItems="True" OnClientSelectedIndexChanging="loadCombos" OnClientItemsRequesting="buildForm" |
| > |
| <Items> |
| <telerik:RadComboBoxItem Text="" Value="" Selected="True" /> |
| </Items> |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
| <tr> |
| <td>Aircraft:</td> |
| <td> |
| <telerik:RadComboBox ID="cbAircraft" runat="server" Skin="Black" SelectedValue='<%# DataBinder.Eval( Container, "DataItem.Aircraft") %>' |
| EmptyMessage=" Select Aircraft" HighlightTemplatedItems="True" OnClientItemsRequested="ItemsLoaded" |
| OnItemsRequested="radAircraft_ItemsRequested" OnClientItemsRequesting="buildForm" EnableLoadOnDemand="false" |
| AppendDataBoundItems="true"> |
| <Items> |
| <telerik:RadComboBoxItem Text="" Value="" /> |
| </Items> |
| </telerik:RadComboBox> |
Pls help me to come up with the code.
Thanks