I'm using the navigation view in Sencha Touch 2 to provide view navigation in my app.
Currently I'm using the approach of creating a view object (say "VOCABI.view.Search"
, with xtype "searchview"
) in the launch method of the controller and referring to it by including the following in controller config:
refs: {
searchView: 'searchview'
}
When I want to present the search view, I push it into the navigation view like this:
navView = this.getNavView(); // Defined
navView.push([this.getSearchView()]); // Defined by refs
The problem is when the user is done with the search and presses the back button on the view, the searchView seems to be destroyed so that it causes trouble the next time the user wants to search something since the getSearchView()
method now returns null.
Is this the default behavior of navigation view that it destroys the popped view when the method pop()
is called?
If so, would this be a bad workaround to create the search view every time you present it? Like
Ext.create("VOCABI.view.Search");
this.getNavView().push([this.getSearchView()]);
Thanks so much for your help!