zoukankan      html  css  js  c++  java
  • Ext 的Ajax 请求,添加mask 等待效果

    {  
                    text: "删除",  
                    iconCls: "btn-del",  
                    scope: this,  
                    handler: function() {  
                        var f = this.centerPanel;  
                        var d = f.getSelectionModel().getSelections();  
                        if (d.length == 0) {  
                            Ext.ux.Toast.msg("信息", "请选择要删除的记录!");  
                            return;  
                        }  
                        var g = Array();  
                        for (var e = 0; e < d.length; e++) {  
                            g.push(d[e].data.dicId);  
                        }  
                        Ext.Msg.confirm("信息确认", "您确认要删除所选记录吗?",  
                        function(h) {  
                            if (h == "yes") {  
                                <span style="color:#FF6666;">Ext.getBody().mask("请稍等,正在删除中...","x-mask-loading");</span>  
                                Ext.Ajax.request({  
                                    url: __ctxPath + "/system/multiDelDictionary.action",  
                                    params: {  
                                        ids: g  
                                    },  
                                    method: "POST",  
                                    success: function(i, j) {  
                                        <span style="color:#FF6666;">Ext.getBody().unmask();</span>  
                                        Ext.ux.Toast.msg("操作信息", "成功删除该数字字典!");  
                                        f.getStore().reload();  
                                    },  
                                    failure: function(i, j) {  
                                        <span style="color:#FF6666;">Ext.getBody().unmask();</span>  
                                        Ext.ux.Toast.msg("操作信息", "操作出错,请联系管理员!");  
                                    }  
                                });  
                            }  
                        });  
                    }  
                },  

    方法二:(标红部分)

    var myMask = new Ext.LoadMask(Ext.getBody(), {    
                  msg: '正在保存,请稍后!',    
                  removeMask: true //完成后移除    
    });    
    myMask.show(); Ext.Ajax.request({ url :
    'infoPlatform/TogBuy!publish.action', waitMsg : '正在发布...', scope : this, success : function(f, o) { myMask.hide(); App.setAlert(true, "test"); }, failure : function(f, o) {   myMask.hide(); App.setAlert(false, "test"); }

    转自:http://blog.csdn.net/dracotianlong/article/details/8132664

  • 相关阅读:
    Model2
    servlet_获取初始化参数
    Java_Reflect反射
    Java Web_过滤器
    JSP状态管理_1_Cookie
    JSP_内置对象_session
    Sql Server中的数据类型和Mysql中的数据类型的对应关系(转)
    组合权限查询 SQL,UniGUI
    BIM 3D 数据交换格式 ----张建平(清华女)
    即速应用_微信小程序开发 http://www.jisuapp.cn/
  • 原文地址:https://www.cnblogs.com/azhqiang/p/4679315.html
Copyright © 2011-2022 走看看