Back button, bypassing a page

6 posts, 2 answers
  1. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 05 Dec 2014 Link to this post

    Hi
      Apologies in advance as I suspect this is probably obvious, just not to me

    Can you make the back button or href navigation (data-role="backbutton") miss out pages?

    I have a collection of views

    A->B->C1->D1
                  |      |
                C2->D2

    Here the user may go from View A to B, if they hit back they'll go back to A. Fine

    They may go A->B->C1->C2->C1->C2, if they hit back they'll go back through the sequence again but I'd like them to go back to B, i.e. bypassing the C1->C2->C1 sequence, almost as though C1 and C2 were the same page

    I can't go directly to B from C2 as they may not have come to C2 from B, they may have come from somewhere else

    So Ideally there would be something which would let you navigate between to C2 and C1 without going into the history

    I'm guessing you can do something in raw javascript with the history object to do this but I'm wondering what the 'kendo' way to do this is

    thanks




  2. Answer
    Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 08 Dec 2014 Link to this post

    Hello Anthony,

    you can use the router.replace navigation method. 

    Regards,
    Petyo
    Telerik
     
    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. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 09 Dec 2014 in reply to Petyo Link to this post

    Yep, that's seems to work great, thanks

  5. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 15 Jan 2015 in reply to Anthony Link to this post

    Hi
      I'm returning to this after a gap.

    Although this worked in a standalone example it didn't work in the main product. The jsfiddle below shows why:

      http://jsfiddle.net/xhr84fq8/

    This takes you through the route:
    homepage->filter -> [picker1, picker2]

    where I want the last 2 to be treated as the same page. If you rightclick and 'back' it gets stuck between picker1 and picker2

    It works if you remove the 'data-role="button"' attribute from the hyperlink (there is a comment above it), now you can go between picker1 and picker2 as much as you like and the back button will take you back to the 'filter' view

    Whats the reason behind this? How can I make buttons work in the same manner? I have a tabstrip which is turning hyperlinks into buttons so I'm not adding the attribute directly

    thanks
  6. Answer
    Petyo
    Admin
    Petyo avatar
    2438 posts

    Posted 19 Jan 2015 Link to this post

    Hello Anthony,

    please check an updated version of your example, which, I believe, works as expected. Notice that you should not use onclick event handling in mobile applications, due to the 300ms delay. 

    Regards,
    Petyo
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Anthony
    Anthony avatar
    122 posts
    Member since:
    Jun 2013

    Posted 19 Jan 2015 in reply to Petyo Link to this post

    Yes, that worked thanks. And thanks for the 300ms info, I wasn't aware of it

Back to Top
Kendo UI is VS 2017 Ready