cranberies
cranberies

Reputation: 441

preload flex application with extjs

in my application basically coded with extjs , i have a module coded with flex 4 the problem is that flex makes long time at the first load , so i wonder if i can preload flex before the user need it

This is the code for the ext window that host the flex application :

function openPdf(){
    var user = Ext.get('userName').getValue();
        PlanRs = new Ext.Window({
            width:'100%',
            autoHeight:true,
            autoScroll:true,
            html:'<iframe src ="PlanRs/index/bin-debug/index.html?user='+user+'" ></iframe>',
            bbar:[{
                text:'Close',
                handler:flexAppCloseHandler
            }]
        })         
   PlanRs.show(); 
}

i have tried to instantiate the window and make it invisible until user call with no success!

Upvotes: 0

Views: 492

Answers (1)

ChrisR
ChrisR

Reputation: 14457

When you create the Ext.Window it still isn't rendered due to ExtJS's lazy rendering mechanism. This means that the iframe isn't inserted into the DOM as long as the component isn't rendered by calling show() for example.

Try instantiating your Ext.Window and calling PlanRs.render() manually and only call PlanRs.show() in your openPdf() function.

Upvotes: 1

Related Questions