How to open actionsheet on the click of button

4 posts, 0 answers
  1. Akash
    Akash avatar
    2 posts
    Member since:
    Feb 2013

    Posted 27 Feb 2013 Link to this post

    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
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 28 Feb 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Akash
    Akash avatar
    2 posts
    Member since:
    Feb 2013

    Posted 15 Mar 2013 Link to this post

    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
  5. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 19 Mar 2013 Link to this post

    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!
Back to Top
Kendo UI is VS 2017 Ready