Andrea Casaccia
Andrea Casaccia

Reputation: 4971

Sencha Touch: How does Ext.app.Application.launch() work?

I've been working with Sencha Touch for a fair amount of time, and I created a bunch of applications, but I think I am still missing one of the key concepts in Sencha development: I was wondering how does Ext.app.Application.launch() work to add to the viewport the views I create.

During launch() is it:

Ext.create('MyApp.view.Main');

equivalent to:

Ext.Viewport.add( Ext.create('MyApp.view.Main') );

If so, is this a feature implemented somehow in the application launch(), or does creating a View always adds it on top of the Viewport, regardless of being during launch()? I can't find any documentation about it, nor I could find the relevants piece of code in the sources.

Can someone explain how this works, or point me in the right direction?

Upvotes: 1

Views: 676

Answers (1)

chinabuffet
chinabuffet

Reputation: 5588

Does your MyApp.view.Main have fullscreen: true set on it? That config, per the docs, does:

Force the component to take up 100% width and height available, by adding it to Ext.Viewport.

From my understanding, Ext.app.Application.launch() is effectively just the same as Ext.onReady, but it's the recommended entry point for MVC applications.

Upvotes: 1

Related Questions