PDA

View Full Version : Config renderTo in Sencha Architect



blacasa
10 Sep 2013, 11:42 PM
Hi,

I'm using Sencha Architect to create two views. Both views are a panel with a button.
Panel1 has a button that hide the panel1 and display the panel2.
Panel2 has a button that hide the panel2 and display the panel1.

Panel1 is the initial view.

If I had "renderTo: Ext.getBody()" into the panel2.js, it works.
But I can't had this code via Sencha Architect. When I write "Ext.getBody()" into the renderTo config editor, it's not added to the generated code.
How can I add "Ext.getBody()" using Sencha Architect?

Thx,

Mthor
11 Sep 2013, 4:33 AM
you need to put the two panels in a container or view-port, then select that view port to be your initial View.

aconran
11 Sep 2013, 7:18 AM
In most cases renderTo is not needed. The times where you do want to use it is when it is the top level view (as Mthor has suggested above) and Architect will automatically take care of that when you mark it as the initial view.

Other times you need it is when you have a very specific web page layout (not a typical app) and want to render parts of your application one place and parts of your application another place. In 99.9% of cases, you should not use renderTo to render components inside of components.

If you still need code to execute for putting in Ext.getBody() for your renderTo I suggest doing this via processConfig (Ext JS) or init (Sencha Touch).