Hi,
Refer to the example of Related ComboBoxes (3 combo boxes: Continent, Country, City), is it possible to interact between combo boxes without postback? (without using the OnItemRequested or OnClientItemRequested events)
And is it possible to call WCF inside the javascript and fills values to the combo box directly?
Thank You.
Refer to the example of Related ComboBoxes (3 combo boxes: Continent, Country, City), is it possible to interact between combo boxes without postback? (without using the OnItemRequested or OnClientItemRequested events)
And is it possible to call WCF inside the javascript and fills values to the combo box directly?
Thank You.
7 Answers, 1 is accepted
0
Hello Omar Suria,
If you bind the second and third combos to WCF service and not to ItemsRequested server event then calling the requestItems() javascript method will fire the proper WCF operation contract and the items will be loaded.
Regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
If you bind the second and third combos to WCF service and not to ItemsRequested server event then calling the requestItems() javascript method will fire the proper WCF operation contract and the items will be loaded.
Regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
tomekm
Top achievements
Rank 1
answered on 11 Nov 2009, 01:17 PM
| var continentCombo; | ||||||||||||||
| var countryCombo; | ||||||||||||||
| var cityCombo; | ||||||||||||||
| function pageLoad() { | ||||||||||||||
| // initialize the global variables | ||||||||||||||
| // in this event all client objects | ||||||||||||||
| // are already created and initialized | ||||||||||||||
| continentCombo = $find("<%= RadComboBox1.ClientID %>"); | ||||||||||||||
| countryCombo = $find("<%= RadComboBox2.ClientID %>"); | ||||||||||||||
| cityCombo = $find("<%= RadComboBox3.ClientID %>"); | ||||||||||||||
| } | ||||||||||||||
| function requestCountry(sender, e) { | ||||||||||||||
| var context = e.get_context(); | ||||||||||||||
| context["CountryId"] = continentCombo.get_selectedItem().get_value(); | ||||||||||||||
| } | ||||||||||||||
| function requestCity(sender, e) { | ||||||||||||||
| var context = e.get_context(); | ||||||||||||||
| context["CityId"] = countryCombo.get_selectedItem().get_value(); | ||||||||||||||
| } | ||||||||||||||
| function ItemsLoaded(combo, eventArqs) { | ||||||||||||||
| if (combo.get_items().get_count() > 0) { | ||||||||||||||
| // pre-select the first item | ||||||||||||||
| combo.set_text(combo.get_items().getItem(0).get_text()); | ||||||||||||||
| combo.get_items().getItem(0).highlight(); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| function ContinentChanged(combo, eventArqs) { | ||||||||||||||
| countryCombo.clearItems(); | ||||||||||||||
| countryCombo.clearSelection(); | ||||||||||||||
| } | ||||||||||||||
| function CountryChanged(combo, eventArqs) { | ||||||||||||||
| cityCombo.clearItems(); | ||||||||||||||
| cityCombo.clearSelection(); | ||||||||||||||
| } | ||||||||||||||
|
||||||||||||||
0
tomekm
Top achievements
Rank 1
answered on 12 Nov 2009, 10:45 AM
Above is my solution to related comboboxes databound with WCF service.
Its only flaw is that user must select item with mouse or arrows and not by typing first letters because then combobox requests items again and they are duplicated.
Anyone can come up with idea how to improve it?
0
Hi Rychu,
Your code seems fine.
Are you referring to this issue?
FIX: Items loaded on demand can be added multiple times on scroll (Q3 2009 issue)
Regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Your code seems fine.
Are you referring to this issue?
FIX: Items loaded on demand can be added multiple times on scroll (Q3 2009 issue)
Regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
tomekm
Top achievements
Rank 1
answered on 24 Nov 2009, 08:37 AM
Yes.
0
Hello Rychu,
Then please apply one of the workarounds suggested in the forum post to resolve the issue.
All the best,
Simon
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
All the best,
Simon
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
tomekm
Top achievements
Rank 1
answered on 24 Nov 2009, 09:33 AM
Thank you, it resolved issue.