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
How to get value of kendo combobox in the change event
提问by Ashwin
I have 2 questions on kendo combobox change event.
我有 2 个关于剑道组合框更改事件的问题。
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.
任何帮助是极大的赞赏。
回答by Miroslav Popovic
Just use this.value();
只需使用 this.value();
alert("value: " + this.value());
http://demos.kendoui.com/web/combobox/events.html
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.
对于问题#2 - 用于this.element
获取元素本身,以及this.element.parent()
获取元素的父元素。