This is a migrated thread and some comments may be shown as answers.

Back button, bypassing a page

5 Answers 52 Views
View
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 05 Dec 2014, 01:23 PM
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




5 Answers, 1 is accepted

Sort by
0
Accepted
Petyo
Telerik team
answered on 08 Dec 2014, 01:07 PM
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!
 
0
Anthony
Top achievements
Rank 1
answered on 09 Dec 2014, 10:38 AM
Yep, that's seems to work great, thanks

0
Anthony
Top achievements
Rank 1
answered on 15 Jan 2015, 12:18 PM
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
0
Accepted
Petyo
Telerik team
answered on 19 Jan 2015, 08:02 AM

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!
 
0
Anthony
Top achievements
Rank 1
answered on 19 Jan 2015, 10:46 AM
Yes, that worked thanks. And thanks for the 300ms info, I wasn't aware of it

Tags
View
Asked by
Anthony
Top achievements
Rank 1
Answers by
Petyo
Telerik team
Anthony
Top achievements
Rank 1
Share this question
or