prayag ganoje
Top achievements
Rank 1
prayag ganoje
asked on 25 Feb 2010, 12:48 PM
Hello,
I am faily new to Java script. I have tried following code to add 3 elements in the combobox. But it was not successful. Can you please correct me ? Its urgent.
I am faily new to Java script. I have tried following code to add 3 elements in the combobox. But it was not successful. Can you please correct me ? Its urgent.
| var combo = $find('<%=RadComboType.ClientID%>'); |
| var comboItem = new Telerik.Web.UI.RadComboBoxItem(); |
| var inputtext = new Array("A", "B", "C"); |
| for(i=0; i<inputtext.length(); i++) |
| { |
| comboItem.set_text(inputtext[i]); |
| combo.trackChanges(); |
| combo.get_items().add(comboItem); |
| combo.commitChanges(); |
| } |
6 Answers, 1 is accepted
0
Hi Prayag,
In this way you create only one item, please modify it like this:
All the best,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
In this way you create only one item, please modify it like this:
var combo = $find('<%=RadComboType.ClientID%>'); var comboItem; var inputtext = new Array("A", "B", "C"); for(i=0; i<inputtext.length(); i++) { combo.trackChanges(); comboItem = new Telerik.Web.UI.RadComboBoxItem(); comboItem.set_text(inputtext[i]); combo.get_items().add(comboItem); combo.commitChanges(); } All the best,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
prayag ganoje
Top achievements
Rank 1
answered on 25 Feb 2010, 03:27 PM
Sorry. But this is not working out.
The drop down window shows nothing i.e. blank. No value displayed.
Also it has added some bug. The drop dwon window is "growing as blank" for every click.
The drop down window shows nothing i.e. blank. No value displayed.
Also it has added some bug. The drop dwon window is "growing as blank" for every click.
0
Shinu
Top achievements
Rank 2
answered on 26 Feb 2010, 09:29 AM
Hello Prayag,
The code given above worked for with after a small change in code. I removed the brackets for the inputtext.length since its not a method.
javascript:
Feel free to share the comments.
All the best,
Shinu.
The code given above worked for with after a small change in code. I removed the brackets for the inputtext.length since its not a method.
javascript:
| var combo = $find('<%=RadComboType.ClientID%>'); |
| var comboItem; |
| var inputtext = new Array("A", "B", "C"); |
| for (i = 0; i < inputtext.length; i++) { |
| combo.trackChanges(); |
| comboItem = new Telerik.Web.UI.RadComboBoxItem(); |
| comboItem.set_text(inputtext[i]); |
| combo.get_items().add(comboItem); |
| combo.commitChanges(); |
| } |
All the best,
Shinu.
0
prayag ganoje
Top achievements
Rank 1
answered on 26 Feb 2010, 10:02 AM
Hi Shinu.
It solved my problem. Thanks for your help.
One more issue I am facing is that before the combobox items there is small white space left with. Which I can't remove.
Same is marked in the image attched. Can you please suggest how to remove it ?
It solved my problem. Thanks for your help.
One more issue I am facing is that before the combobox items there is small white space left with. Which I can't remove.
Same is marked in the image attched. Can you please suggest how to remove it ?
0
prayag ganoje
Top achievements
Rank 1
answered on 26 Feb 2010, 10:04 AM
Hi Shinu.
It solved my problem. Thanks for your help.
One more issue I am facing is that before the combobox items there is small white space left with. Which I can't remove.
Same is marked with RED color in the image attched. Can you please suggest how to remove it ?
It solved my problem. Thanks for your help.
One more issue I am facing is that before the combobox items there is small white space left with. Which I can't remove.
Same is marked with RED color in the image attched. Can you please suggest how to remove it ?
0
Hello Prayag ganoje,
I've tested the combobox and there's no such space. Can you send us a live url where we could observe it? Alternatively, you can open a support ticket and send us a simple page there.
Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I've tested the combobox and there's no such space. Can you send us a live url where we could observe it? Alternatively, you can open a support ticket and send us a simple page there.
Kind regards,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.