Reputation: 149
I am really struggling to select an option from my combo box based on the text rather than value. I have a combo box which has a datasource attached to it which are countries. These countries are stored in the database. I want the default country to be "United Kingdom". At the moment I am doing the following:
combobox.select(combobox.text("United Kingdom"));
However, this only shows the text and doesn't actually select it because the select function does not trigger. Any help with this?? I want the value to be applied. I have an alert in the select function which is not appearing.
Upvotes: 3
Views: 4379
Reputation: 1086
Selecting kendo comboBox value explicitly from javascript don't trigger the "Select" event.
In order achieve that you have to trigger the "Select" event after setting the required value. e.g.
var myComboBox = $('#comboBoxId').data('kendoComboBox');
myComboBox.text("United Kingdom");
myComboBox.trigger("select");
Hope this will solve your purpose. Also check here.
Upvotes: 3