ExtJs 4中 Ext.Ajax.request提交实现waitMsg效果
步骤1、在Ext.Ajax.request请求之前加一个mask图层
1
2
|
var
myMask =
new
Ext.LoadMask(Ext.getBody(),{msg:
"请等候..."
});
myMask.show();
|
步骤2、在Ext.Ajax.request回调函数里首先把图层隐藏掉
1
if
(myMask != undefined){ myMask.hide();}
|
完整代码如下:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"请稍等,正在导入..."
});
myMask.show();
Ext.Ajax.request({ url:
"uploadAction"
,
method:
"POST"
params:{
id:id
},
success:
function
(){
(myMask != undefined){ myMask.hide();}
Ext.Msg.alert(
"消息"
"文件导入成功!"
);
failure:
(){
(myMask != undefined){ myMask.hide();}
}
});
|