Managing views and the viewport
Heya,
I've started dabbling in Sencha Touch in the past 2 days and I must admit that it's as accessible as a brick wall. However, I like the flexibility and the power it gives, so I am sticking with it. That being said...
I've read a fair share of posts and tutorials, and since all of them were small examples, they all defined their views in the app.js, adding them to the viewport right away, like so:
Code:
var homePage = {
xtype: "homepage"
};
var loginPage = {
xtype: "login"
};
Ext.Viewport.add([homePage, loginPage]);
As my app is increasing in size though, I don't believe this is a favorable approach. I'd like to load content when I need it, and clear out stuff from the viewport once it's no longer required. Is there a simple way of doing this? Any page I load currently I initialize and add to the viewport right there in the controller, however I worry that if the page is called multiple times it will be added to the viewport multiple times as well, kinda defeating the whole purpose. Any help in this matter would be greatly appreciated. Thanks in advance.
Best regards,
Damir H.