Quote Originally Posted by danielleng View Post
I like the quoted example (above) of declaring Models/Stores/Controllers arrays in the Ext.application. However in my code I still need to declare the Models array inside my controller (as opposed to declaring it in app.js) for it to work.
Following the above example, even after declaring the Models array inside app.js, we would still need to reference it in the Store class rite ? Say...
-StoreA.js
Code:
model: 'app.model.ModelA'
If so then there's really no need to do it in app.js ? Its just writing extra code for no reason. I could skip declaring models array in app.js and it would still work.!
"If so then there's really no need to do it in app.js ? Its just writing extra code for no reason."
You said declaring the "models array" doesn't work in app.js, so yes it would be useless code.
You said it does work when you declare the "models array" in the controller so that should be sufficient; even if it did work in app.js because as you say it would become extra code for no reason.

Yes I am aware that the Viewport should be created as a view rather than explicitly created in the Launch function of app.js. It seems easier to have the application's "main" panel be created in app.js, and then add the other views from there.
According to the API the viewport is "a specialized container representing the viewable application area (the browser viewport)." And since there can only be 1 viewport per page, I assume it is declared in the launch() function. (as done by some of the Extjs examples) And since the layout (border, fit etc) is declared inside the Ext.create of the viewport, I believe you can't move it out of the Launch() function ?
The MVC Architecture documentation itself shows that approach.