I'm using ST2.1 MVC.
I have a login view which on success loads a view with a list (dataview) of items.
The user can click an item and it loads an individual edit view for that item. E.g. each item is a different type and has a different type of edit view.
Login -> Items -> Item Edits.
I found some discussion about how views should be destroyed? from the viewport but I could not find a definitive approach or discussion in the docs about how to go about this.
With some experimentation in my login button success I do the following to show the 'items' view:
In the MyApp.view.Items I have a logout button which does this
var itemsview= Ext.create('MyApp.view.Items');
// I dont destroy the login screen as I have a logout button that when pressed removes it (see next code section)
which mostly works to (seemingly) remove the MyApp.View.Items from the viewport and the login screen is displayed.
From the clicking on an item in MyApp.View.Items view I call the Edit view (associated with the item ) in a similar way ( from a tap event ):
This loads the edit view (although I have to reload some shared components that where already in the item view - not sure why - will create a separate post for this).
var editview= Ext.create('MyApp.view.Edit');
// not destroying the itemview as we want to come back to that from the editview
Now I would have thought that if I have a 'back' button on my edit view and do the following (below) that this would take me back to the 'items' list view - it doesnt it takes me back to the 'login' screen!
Obviously I am missing something here in my understanding.
// remove the active view from the viewport - which is the edit scren
// this will show the list screen as we never removed that i.e. that
// is the previous one in the stack.
Any help / understanding of best approach to moving views in and out of the app viewport to ensure memory management and screens don't need to be repopulated with data with this and in my example above how to achieve this would be appreciated greatly.