Mobile Action Sheet data-actionsheet-context

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    1 posts
    Member since:
    Jun 2015

    Posted 03 Jun 2015 Link to this post

    Hello.

    I'm frustrated with the lack of support for the mobile action sheet, specifically the fact that the only examples online simply have you set the data-actionsheet-context to a simply string argument. This is rarely practical, as there is almost always a need here to pass in data from a datasource, however all I've managed to achieve is getting data from a vm through data-bind="text:example.exampleId". How, or specifically what is the syntax for, setting data-actionsheet-context to a string that is bound such as from the data-bind=""? Do you have to data-bind"source: " in order to be able to get at the data. Nothing seems to be working other than passing in a literal string.

     Thank you in advance for any feedback.

  2. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 08 Jun 2015 Link to this post

    Hello Ryan,

    You can bind the the action sheet context to a value from the data context using a binding expression, as shown in this demo:
    ActionSheet / Basic usage

    <a class="reply"
        data-role="button"
        data-rel="actionsheet"
        href="\\#inboxActions"
        data-actionsheet-context="#:ID#">Reply</a>

    where ID is a value from the data context in which the button is defined, in this case a ListView data item.

    Regards,
    Tsvetina
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top