View Full Version : Complex layout prerendering

7 Nov 2012, 6:13 AM
Is there any simple way to prerender complex layout (main screen) when I present login screen (using delayed task or something similar)?
When I switch the panel/card to main view using card layout the rendering/initialization takes about 10 seconds on IE. I see this time has been spent mainly on style get/set operations...


7 Nov 2012, 6:59 AM
Is deferredRender (option of Card layout) set on true?

8 Nov 2012, 2:18 AM
I implemented the code a bit different (without card layout on "shel" view - shell inherits from Container).
I just detach one panel and attach the second one (I want to show Login panel asap after app start without waiting for "synchronous" dom tree reconstruction for all the panels).

So I did something like this ("me" is the shell that inherits from Container):

me.remove( this.loginView, false );
me.add( this.mainView );

I see such config property like renderTo that can use existing dom element and I wonder if it can help in such case...


8 Nov 2012, 2:27 AM
That will not help, it will render on that div then with the same delay. Why not using a card layout?

8 Nov 2012, 2:50 AM
I thought about rendering on this div using DelayedTask that will start after rendering LoginView.
When I use card layout on shell container it takes much more time to do initialization so I look for a way to do complex layout initialization/rendering as background task that doesn't stop main flow of app initialization for the time of main view initialization...

8 Nov 2012, 2:53 AM
you can try to set that on the panel you add.

renderTo: idOfDiv

8 Nov 2012, 3:17 AM
Unfortunately there is something else to do yet. I see exception like below:
Unable to get value of the property 'dom': object is null or undefined
Place of exception is in Ext.dom.Helper class, method part is below:

doInsert: function(el, o, returnElement, pos, sibling, append) {
el = el.dom || Ext.getDom(el);

I did it from regular initialization instead of DelayedTask yet...