PDA

View Full Version : Complex layout prerendering



stalek
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...

Thanks,
Alex

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

stalek
8 Nov 2012, 2:18 AM
Hi,
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...

Alex

tvanzoelen
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?

stalek
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...

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

renderTo: idOfDiv

stalek
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...