How to trigger the back button when swiping right

4 posts, 1 answers
  1. Yohann
    Yohann avatar
    54 posts
    Member since:
    Jan 2014

    Posted 20 Jul 2014 Link to this post


    I would like the user to be able to go back to the previous page when swiping right.

    Please help on what is the best way to do it. I've been trying to do it myself with the "touch events" but can't get to something nice.

  2. André
    André avatar
    8 posts
    Member since:
    Oct 2013

    Posted 23 Jul 2014 Link to this post

    What you can do, is create a window manager and when you change the screen add it to the manager stack.

    With touch event, you can create something on each view who will trigger the back function in the manager.
    Also, override the backbutton press event by doing this:

    document.addEventListener("backbutton", function onBackKeyDown() {
    //Call to the screen manager back function

    For slide effect, you can enable the window you want by setting

    and add position fixed at your current screen + 0 at each position values.

    Then as your finger drag the view, move the view by animating is left position.

    When x cursor position in touch event is greater than (screen width/2)
    trigger back function in the manager.
    else animate to reset position to original.

    P.S: I'm not a super user and do not know all of telerik solution, but I think my solution could be good for what you want to do.

  3. Answer
    Tina Stancheva
    Tina Stancheva avatar
    3298 posts

    Posted 23 Jul 2014 Link to this post

    Hello Yohann,

    Other options you can try are:
    • If you're using jQueryMobile, you can follow the approach demonstrated in the Swipe to Navigate demo
    • If you're using Kendo Mobile, you can hook up to the swipe event and navigate to a previous/next View when the user swipes. You can take a look at this small example: However, please note that you would have to keep track of the previous views in the app - for instance save the last view address before navigating away from it. 

    I hope this information helps.

    Regards, Tina Stancheva

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


  4. Yohann
    Yohann avatar
    54 posts
    Member since:
    Jan 2014

    Posted 24 Oct 2014 in reply to Tina Stancheva Link to this post

    Much Better ! Thank you :)
Back to Top