PDA

View Full Version : stop components from auto-rendering



Rampant
21 Jul 2011, 12:05 PM
So if I do an

Ext.setup({
...
onReady:function() {
var aPanel=new Ext.Panel({.....});

}

I notice the panel automatically renders to the screen. But what if I want to set up a number of panels/components and turn them on and off? Or am I just approaching this completely wrong?

Hertz
21 Jul 2011, 3:56 PM
Take a look at the first Example and its explanation:

http://www.sencha.com/blog/sencha-touch-optimizing-memory-usage/

Basically, you don't instantiate, by not using 'new Ext.component'.
And instead, define a JSON object with its corresponding xtype and properties, in a variable.