Javascript 如何在更改事件中获取剑道组合框的值

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11339447/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 05:31:35  来源:igfitidea点击:

How to get value of kendo combobox in the change event

javascriptjqueryeventskendo-ui

提问by Ashwin

I have 2 questions on kendo combobox change event.

我有 2 个关于剑道组合框更改事件的问题。

  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.

  1. 在更改事件时,我想获取该组合框的选定值。

  2. 我想获取对父元素或元素本身的引用。

How to do that? Fiddle is here

怎么做?小提琴在这里

Any help is greatly appreciated.

任何帮助是极大的赞赏。

回答by Miroslav Popovic

Just use this.value();

只需使用 this.value();

alert("value: " + this.value());

http://demos.kendoui.com/web/combobox/events.html

http://demos.kendoui.c​​om/web/combobox/events.html

Edit:

编辑:

For question #2 - use this.elementto get the element itself, and this.element.parent()to get element's parent.

对于问题#2 - 用于this.element获取元素本身,以及this.element.parent()获取元素的父元素。