使用 extjs 预加载 Flex 应用程序
在我的应用程序中基本上用extjs编码,我有一个用flex 4编码的模块,问题是flex在第一次加载时花费很长时间,所以我想知道我是否可以在用户需要之前预加载flex
这是ext窗口的代码托管 Flex 应用程序:
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();
}
我尝试实例化该窗口并使其不可见,直到用户调用但没有成功!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您创建 Ext.Window 时,由于 ExtJS 的延迟渲染机制,它仍然没有渲染。这意味着只要组件没有通过调用
show()
等方式呈现,iframe 就不会插入到 DOM 中。尝试实例化 Ext.Window 并手动调用
PlanRs.render()
,并且仅在openPdf()
函数中调用PlanRs.show()
。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 callPlanRs.show()
in youropenPdf()
function.