Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get value of kendo combobox in the change event

I have 2 questions on kendo combobox change event.

  1. On change event I want to get the selected value of that combobox.

  2. 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.

like image 975
Ashwin Avatar asked Jul 05 '12 07:07

Ashwin


People also ask

How do I value my kendo ComboBox?

load("@Url. Action("Load", "Home")" + id); var selected = $('#typesCombo'). data('kendoComboBox'). val(); if (selected == '') { ... }

How do I get the selected text of kendo DropDownList?

$("#ddl"). data("kendoDropDownList"). text();

How do I set default value in kendo ComboBox?

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.

How do I reset my kendo ComboBox?

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").


1 Answers

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.

like image 139
Miroslav Popovic Avatar answered Sep 20 '22 08:09

Miroslav Popovic