ExtJs的Ext.Ajax.request实现waitMsg等待提示效果

时间:2021-09-06 21:49:45
一、  fp.form.submit 有waitMsg 属性来设置等待效果,如下。但是对于Ext.Ajax.request来说 waitMsg 并不起作用。     
               fp.form.submit({
                           url : '',
                           waitTitle : "[性别]修改",
                           waitMsg : '正在提交数据,请稍后... ...',
                           success : function(form, action) {
                                     Ext.MessageBox.alert('提示信息',action.result.msg);
                           },
                           failure : function(form, action) {
                                Ext.MessageBox.alert('提示信息', "更新性别有误!");
                           }
               });
 
二、Ext.Ajax.request实现waitMsg等待提示效果
          Ext.MessageBox.confirm('Message', '请问您确定要修改性别吗?', function(btn) {
                 if (btn == 'yes'){
                     var myMask = new Ext.LoadMask(Ext.getBody(), { 
                         msg: '正在提交申请,请稍后!'
                     }); 
                     myMask.show();
                     Ext.Ajax.request({
                           url : '',
                           params : {
                                sex : sex
                                     },
                           success : function(response,option) {                                           
                                     var res = Ext.decode(response.responseText);
                                     if(res.success){
                                          myMask.hide();
                                          Ext.MessageBox.alert('提示信息', res.msg);
                                     }else{
                                           myMask.hide();
                                           Hs.util.Msg('提示信息', res.msg);
                                     }          
                           },
                           failure : function(form, action) {
                                myMask.hide();
                                Hs.util.Msg('提示信息', response.msg);
                           }
                     });
                }
        });