4 Answers, 1 is accepted
0
Accepted
Hello Sergi,
The items that you have in your combobox depend on the data passed to the dataSource field when you initialize it. In order to clear the contents of your combobox I would suggest two ways to do it:
Regards,
Kiril
the Telerik team
The items that you have in your combobox depend on the data passed to the dataSource field when you initialize it. In order to clear the contents of your combobox I would suggest two ways to do it:
- You can use the setDataSource() method without parameters so you will set empty value to the dataSource field to clear the combobox:
$("#comboBox").data("kendoComboBox").setDataSource();
In this case in order to bind your data again you will need to save the data that you get from your AJAX request to a variable, so you can bind it when its needed again. - Another way to achieve your goal is to clear out the value of the combobox and then disable it. This way nothing will be shown in the combobox and it will be disabled, so the users will not be able to click on it.
Here is an example:
var combobox = $("#comboBox").data("kendoComboBox");
combobox.value();
combobox.enable(false);
Regards,
Kiril
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sergi
Top achievements
Rank 1
answered on 18 Jun 2013, 08:40 AM
Thanks, I will clear the value and disable the combobox as you propose, I don't feel comfortable having to change the datasource back and forth.
0
Yuri
Top achievements
Rank 1
Iron
answered on 29 Apr 2014, 12:47 PM
I used your sugesstion of how to empty combo, but when I initilized the combo again (insert again url, etc) it didn't work.
Do you have simpler way?
Do you have simpler way?
0
Hi Sharon,
Can you please extract a runnable sample in a Kendo UI Dojo where you can exactly demonstrate what you are doing, so we can reproduce the issue and advise you further?
You can also start your own thread, so we can easily track down all the issues our users have.
Thank you in advance for your cooperation.
Regards,
Kiril Nikolov
Telerik
Can you please extract a runnable sample in a Kendo UI Dojo where you can exactly demonstrate what you are doing, so we can reproduce the issue and advise you further?
You can also start your own thread, so we can easily track down all the issues our users have.
Thank you in advance for your cooperation.
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!