简体   繁体   中英

How do i get the selected item from kendo UI actionsheet?

I'm creating a cordova app using the kendoUI actionsheet to build a prompt-like interface that allows to choose between different options, but i cannot find on the website HOW to get the value of the selected option! here is the code:
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???
}

Check out 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."

So, the close event does not tell you what action was selected, but you can store it in the callback(s) and use it in the close.

Demo: http://dojo.telerik.com/@Stephen/aralO

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM