I have 2 questions on kendo combobox change event.
On change event I want to get the selected value of that combobox.
I want to get the reference to the parent element or an element itself.
How to do that? Fiddle is here
Any help is greatly appreciated.
load("@Url. Action("Load", "Home")" + id); var selected = $('#typesCombo'). data('kendoComboBox'). val(); if (selected == '') { ... }
$("#ddl"). data("kendoDropDownList"). text();
The selection can be set programmatically by calling the select() method on the widget instance. The following for example will set the selection to 'Thing1'. Finally, if you are using MVVM with declarative initialization, you can bind the selection to a value on a View Model.
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").
Just use this.value();
alert("value: " + this.value());
http://demos.kendoui.com/web/combobox/events.html
Edit:
For question #2 - use this.element
to get the element itself, and this.element.parent()
to get element's parent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With