Can you help me with my dojo here? In this experiment I'm trying to redirect to the login-view. Doesn't work, neither in the change event nor in the route callbacks. Plus using the change event produces an infinite loop (on FF38).
9 Answers, 1 is accepted
thank you for trying to help me, but there are some issues with this approach:
1) It freezes my firefox when I run it and click on the tap strip
2) We would need to add this workaround to every view and every controller. That's what the router should be for.
3) It does not use Kendo's router
Maybe someone can clarify why the router doesn't work in this scenario?
Using your dojo: I managed to get rid of my firefox freeze.
Did you notice that the tab strip is not reflecting the view being redirected to?
I debugged the kendo.mobile.js code and learned that in "kendo.mobile.js" _startHistory() is called by the bootstrapper funtion of the kendo Application. Here a new kendo.Router is already created. I think my scenario won't work because effectively I have two routers flying around and messing things up.
So the question is: how/where/when do I register my routes and the change callback on the already created router of the application object? I need to have access to angular's $rootScope in those functions.
@Petyo, I can now reproduce the firefox freeze in your dojo. If one clicks fast multiple times on the tab strip, then firefox freezes. Doesn't happen every time, so give it some seconds. This might be a timing issue.
I would like to point out couple of things:
- Kendo UI Mobile does not officially support the Firefox browser.
- The router of the mobile application is exposed as a field.
- The approach you have taken (using the router methods explicitly for navigation) is not very common one. However, you may fully facilitate it by disabling the mobile app router, and navigating manually.
thanks for the information. I appreciate it.
Regarding the freeze on fast mouse clicks in FF: I think this is more of an exotic issue, because my mouse button is broken and produces fast double-clicks randomly. To be precise, bits of tobacco found their way into the mechanics :-)
I reverted to using angular's $location. Probably this approach will produce other problems on my way, but it works for the current state of our application. I will revisit kendo's navigation when $location falls apart for me.
Feature request: It would be great if Kendo UI Mobile would provide a built-in mechanism for the authorization scenario, which should be a common scenario. A simple redirection-callback somewhere on the Application would be great.
Sidenote: I tried to get hold of the Application's router. This turned out to be tricky because the router is created at a very late stage. I modified kendo's code to create it earlier and used the widget-creation event to get hold of it. But at the end using the Application's router didn't work either. The machinery was just not designed to support what I wanted.
the scenario you describe (decoupling the router from the mobile app) is fully supported - I linked the configuration option in my previous post. Afterwards, you would be able to use angular $location or the kendo ui router, and navigate the mobile app manually.
In case you decide to go with that implementation and need further assistance, please let us know.