我如何从 kendo UI 操作表中获取所选项目?
How do i get the selected item from kendo UI actionsheet?
我正在使用 kendoUI 操作表创建一个 cordova 应用程序来构建一个类似提示的界面,允许在不同的选项之间进行选择,但我在网站上找不到如何获取所选选项的值!这是代码:
HTML
<body>
<div data-role="view">
<a data-role="button" data-rel="actionsheet" href="#actionsheet">Open</a>
<ul id="actionsheet" data-role="actionsheet" data-cancel="Close" data-close="onClose">
<li><a>Foo</a></li>
<li><a>Bar</a></li>
</ul>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="scripts/platformOverrides.js"></script>
<script type="text/javascript" src="kendo/js/jquery.min.js"></script>
<script type="text/javascript" src="kendo/js/kendo.all.min.js"></script>
<script type="text/javascript" src="kendo/js/cultures/kendo.culture.it-IT.min.js"></script>
<script type="text/javascript" src="scripts/index.js"></script>
<script type="text/javascript" src="scripts/scriptmulti.js"></script>
Javascript (scriptmulti.js)
var app = new kendo.mobile.Application();
function onClose(res) {
???what to do???
}
查看 http://docs.telerik.com/kendo-ui/controls/hybrid/actionsheet/actionsheet#execution-of-actions
"Each link in the ActionSheet should have a data-action attribute set, specifying the callback method to be executed when the user taps it."
因此,关闭事件不会告诉您选择了什么操作,但您可以将其存储在回调中并在关闭时使用它。
我正在使用 kendoUI 操作表创建一个 cordova 应用程序来构建一个类似提示的界面,允许在不同的选项之间进行选择,但我在网站上找不到如何获取所选选项的值!这是代码:
HTML
<body>
<div data-role="view">
<a data-role="button" data-rel="actionsheet" href="#actionsheet">Open</a>
<ul id="actionsheet" data-role="actionsheet" data-cancel="Close" data-close="onClose">
<li><a>Foo</a></li>
<li><a>Bar</a></li>
</ul>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="scripts/platformOverrides.js"></script>
<script type="text/javascript" src="kendo/js/jquery.min.js"></script>
<script type="text/javascript" src="kendo/js/kendo.all.min.js"></script>
<script type="text/javascript" src="kendo/js/cultures/kendo.culture.it-IT.min.js"></script>
<script type="text/javascript" src="scripts/index.js"></script>
<script type="text/javascript" src="scripts/scriptmulti.js"></script>
Javascript (scriptmulti.js)
var app = new kendo.mobile.Application();
function onClose(res) {
???what to do???
}
查看 http://docs.telerik.com/kendo-ui/controls/hybrid/actionsheet/actionsheet#execution-of-actions
"Each link in the ActionSheet should have a data-action attribute set, specifying the callback method to be executed when the user taps it."
因此,关闭事件不会告诉您选择了什么操作,但您可以将其存储在回调中并在关闭时使用它。