PDA

View Full Version : MVC Viewport Examples



bweiler
19 Apr 2011, 9:03 AM
I see the following in a lot of the examples so I am using it as I learn Sencha Touch, but I continue to run accross situations where minor restructuring breaks my code and I get the following error.

TypeError: Result of expression 'this.application.viewport' [undefined] is not an object.

It is not clear if "application: this" is even related to "this.application" in the controller.

Is this the Sencha recommended way of creating and referencing viewports?

thanks


App.js:


launch: function() {

this.viewport = new MyApp.views.Viewport({
application: this
});
}



Controller.js:


this.application.viewport.setActiveItem(view, {
type: 'slide',
direction: 'left'
});