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

Tabstrip issue when preventing navigation

3 Answers 176 Views
TabStrip (Mobile)
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 18 Jun 2013, 09:40 PM
Hi Guys,
  I noticed a quirk when testing some code that prevents navigation in before show, as indicated here ... http://docs.kendoui.com/api/mobile/view#events-beforeShow

If I use this technique the tabstrip changes the active tab to the view that was prevented from being displayed, I have a jsfiddle here that demonstrates the issue.  Notice that if you are on view 1, or the view 1 child and you select view 2 (the one that is supposed to be prevented), the navigation is prevented but the tab strip is active on view 2.  I would expect the tabstrip to keep the same tab active as a result of the e.preventDefault call, but perhaps this is deliberate behavior.

  I have a work around for the issue (I just alter the content on view 2 instead of stopping them from navigating to it which is fine for my purposes), so I don't need a fix in a rush I just thought I would bring it to your attention in case you weren't aware.
  -David

3 Answers, 1 is accepted

Sort by
0
Petyo
Telerik team
answered on 20 Jun 2013, 03:21 PM
Hi David,

The jsfiddle you have sent does not feature a tabstrip. However, I think that I understand the case you describe. Indeed, such option would be nice, however it would be very complicated from implementation point of view - the tabstrip should follow the DOM event bubbling and eventually decide if the tab should be changed once all handlers have "passed" successfully (view navigation occurs by handling tap events in the application DOM element). 

A suggestion which may be of use in that case would be to bind to the tabstrip select event - calling preventDefault there will cancel the navigation as well as the tabstrip tab change. 

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
David
Top achievements
Rank 1
answered on 20 Jun 2013, 05:27 PM
Well I feel silly, I forgot to update the link on the old one, the correct one is http://jsfiddle.net/sBUxP/5/ (the previous one a base one I use that has everything setup with the kendo version I am using).

As for the implementation while I agree if you had to listen for every event that could cause a navigation to fail it would be troublesome, but wouldn't you be able to listen for changes to the current location.href to determine which tab to show after a navigation occurs?
0
Petyo
Telerik team
answered on 21 Jun 2013, 12:13 PM
Hi David,

The feature you describe is, in fact, implemented and working. In this case however, the check should be for the hash not being changed, and then revert to the previously selected tab

I hope that at some point we may introduce the means for such feature, but right now it seems too much trouble and additional complexity inserted.

Regards,
Petyo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TabStrip (Mobile)
Asked by
David
Top achievements
Rank 1
Answers by
Petyo
Telerik team
David
Top achievements
Rank 1
Share this question
or