1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    8
    Vote Rating
    0
    nirajanrk is on a distinguished road

      0  

    Default Unanswered: set Touch Gesture to call custom function

    Unanswered: set Touch Gesture to call custom function


    How can I call a custom function upon detecting a touch gesture? I have a function that I would like to call when a certain touch gesture (say taphold) is detected on the iPad.

    Short implementation sample code would be helpful.
    Last edited by nirajanrk; 8 Jun 2012 at 12:20 PM. Reason: More clarification

  2. #2
    Sencha User
    Join Date
    Mar 2010
    Posts
    71
    Vote Rating
    5
    Answers
    1
    mihaipocorschi is on a distinguished road

      0  

    Default


    Just nitpicking but touchhold dont think it qualifies as a touch gesture. Touch gestures are swipes and circles and etc. And implementation depends on what you want to attach the event to (list item, general component, button etc)
    Usually you listen from the controller for.a specific fired event from your ui and you act accordingly.

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    Answers
    3101
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Depends what you are using. On an element you can simple set a listener

    Code:
    el.on('touchhold', someFunc);
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread