Unanswered: Navigation view, history and back button
I have quite big project to realise with Sencha Touch 2 for native packaging application, but I'm still wondering how to architect it.
Let's take an example :
I'm using a navigation view for my product category, here is the section :
products-category-page -> products-yyy-page- -> detail-product
So if I'm starting from the product-category page to reach the detail product page everything is ok and I can use the back button to go back to my first page, like this :
products-category-page <- products-yyy-page- <- detail-product
But let's imagine I'm jumping straight to the detail-product, I still want to display the previous button to go back to the product-yyy-page and so on :
???? <- detail-product
Is there a way to face this situation?
I was thinking about using the route but I'm not sure if it will work with native packaging application or if it's usefull in this situation ?
Sorry for my bad English and thank you so much for your help
Routes will work fine with packaged applications, even though you won't see the URLs.
My approach would be to create a route for each page, and have it do whatever operations are necessary to get you to the right view, regardless of where you're starting from. So the routing function that takes you to the product page should check whether the product page is already there, push it onto the navigation view it isn't, check whether the product detail page is already there, and pop it off the navigation view if it is.
Then you can just call this.redirectTo(productURL) from wherever you are.
Thanks for the information, I'm checking all of this!
Tags for this Thread