我正在为我的应用程序使用Extjs。当extjs完全加载应用程序(图像和所有内容)时,哪个事件/侦听器被触发?extjs 3 - 当extjs完全加载时会触发哪个事件
我试着以下但这些工作的:
- 机构或窗口的onload(body标签是空的)
- 视口渲染听众
我目前在做什么:当我启动它显示“加载”掩码的应用程序。然后ajax请求被触发,当它完成时,“加载”掩码被删除。以下可能会给一些想法:
Ext.onReady(function(){
Ext.ux.mask = new Ext.LoadMask(Ext.getBody(), {msg: "Loading..."});
Ext.ux.mask.show(); // Show the mask
// All components are loaded eg. viewport, tabpanel, button etc...
ajax_request(); // Somewhere between the code ajax request is called
// All components are loaded eg. viewport, tabpanel, button etc...
function ajax_request() {
// Other processing
Ext.ux.mask.hide(); // Hide the mask
}
});
的问题是Ajax请求是需要很长时间,所以我现在想换工作的东西如下:
Ext.onReady(function(){
Ext.ux.mask = new Ext.LoadMask(Ext.getBody(), {msg: "Loading..."});
Ext.ux.mask.show(); // Show the mask
// All components are loaded eg. viewport, tabpanel, button etc...
ajax_request(); // Somewhere between the code ajax request is called
// All components are loaded eg. viewport, tabpanel, button etc...
function ajax_request() {
// Other processing
//Ext.ux.mask.hide(); // Hide the mask - removed
}
// I want to call this when everything is loaded on the page
function everything_loaded() {
Ext.ux.mask.hide(); // Hide the mask
}
});
任何想法,对此有何看法?非常感谢您的帮助。
为什么不使用'Ext.onReady'? – 2011-06-03 02:37:39
In Ext。onReady()所有的组件都被加载,但它们并不是100%的工作状态,在Ext.onReady – user427969 2011-06-03 02:44:45
的最后一条语句中,你是否试图加载自己的图像等?然后在所有组件加载时使用ext? – 2011-06-03 02:52:28