This is a migrated thread and some comments may be shown as answers.

How to open actionsheet on the click of button

3 Answers 174 Views
ActionSheet
This is a migrated thread and some comments may be shown as answers.
Akash
Top achievements
Rank 1
Akash asked on 27 Feb 2013, 09:29 AM
Hi,

<a data-role="button"   data-click="onClick" >Open</a>

<ul data-role="actionsheet" id="actionsheet">
   <li><a data-action="foo">Foo</a></li>
   <li><a data-action="bar">Bar</a></li>
</ul>

function onClick(){
      
        if(i>5)
        {
        // I want to open above action sheet here if condition satisfy, 
        }
        else
        {
        alert("Cannot open action sheet");
        }
       } 

I want to open the actionsheet on the click of button.
After clicking button, onclick function is invoking where i am doing some condition checking.If condition satisfy i want to open action sheet.

Please do the needful.If possible please provide demo in JS Bin

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 28 Feb 2013, 01:38 PM
Hi Akash,

You can open the ActionSheet with the open method of the widget. For more information please refer to the corresponding documentation.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Akash
Top achievements
Rank 1
answered on 15 Mar 2013, 02:30 PM
Hi Alexander,

<a data-role="button"   data-click="onClick" class="clsBtn">Click</a>

<ul data-role="actionsheet" id="actionsheet">
    <li><a data-action="foo">Foo</a></li>
    <li><a data-action="bar">Bar</a></li>
</ul>

<script>
function onClick(){
 $("#actionsheet").data("kendoMobileActionSheet").open();
}

</script>

This is the code which i am using to open an actionsheet on the click of a button.But action sheet is poping up.

Please do the needful.
Thanks in advance.
If possible please provide demo in JS Bin.It's my Sincere request.

Thanks,
Akash
0
Alexander Valchev
Telerik team
answered on 19 Mar 2013, 08:25 AM
Hello Akash,

Your code looks OK and works as expected on my side. Here is a jsBin sample:

Could you please explain what the problem is, am I missing something?

Kind regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ActionSheet
Asked by
Akash
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Akash
Top achievements
Rank 1
Share this question
or