首页  >  文章  >  web前端  >  实现waitMsg等待提示效果的实例代码

实现waitMsg等待提示效果的实例代码

零下一度
零下一度原创
2017-06-26 10:14:462121浏览
一、  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);
                           }
                     });
                }
        });

以上是实现waitMsg等待提示效果的实例代码的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn