如何在剑道菜单中检索 id 值 [英] How to retrieve id value in Kendo menu

查看:28
本文介绍了如何在剑道菜单中检索 id 值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用 Kendo 菜单.我想在单击所选项目时检索 id 值.我使用了 onSelect 事件,并且能够检索所选项目文本.如何检索 id 值?

I am using Kendo menu in my project. I want to retrieve id value when I click on the selected item. I used onSelect event and I am able to retrieve the selected item Text. How can I retrieve the id value?

推荐答案

您可以在初始化它的 UL/LI 结构中设置一个 ID(检查 Robotsushi 的答案).但是,如果你想动态初始化菜单,你可以使用这样的东西 - http://jsfiddle.net/MMRCf/8/

You can set an ID in the UL/LI structure from which you initialize it (check the Robotsushi's answer). However if you want to initialize the menu dynamically you can use something like this - http://jsfiddle.net/MMRCf/8/

这篇关于如何在剑道菜单中检索 id 值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆