我正在使用Extjs开发我的应用程序。当Extjs完全加载应用程序(包括图片和其他内容)时,哪个事件/监听器会被触发?
我尝试了以下方法,但都没有起作用: - body或window的onload事件(body标签为空) - viewport渲染监听器
目前我在做什么:当我启动应用程序时,它会显示“加载”遮罩。然后会发送一个ajax请求,当请求完成后,“加载”遮罩就会被移除。以下可能会给您一些思路:
有什么想法吗?非常感谢您的帮助。
我尝试了以下方法,但都没有起作用: - body或window的onload事件(body标签为空) - viewport渲染监听器
目前我在做什么:当我启动应用程序时,它会显示“加载”遮罩。然后会发送一个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
? - Egy Mohammad Erdin