Ext 的Ajax 请求,增添mask 等待效果

Ext 的Ajax 请求,添加mask 等待效果。

今天在做 Ext.Ajax.request({});的觉得需要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") {
                            Ext.getBody().mask("请稍等,正在删除中...","x-mask-loading");
                            Ext.Ajax.request({
                                url: __ctxPath + "/system/multiDelDictionary.action",
                                params: {
                                    ids: g
                                },
                                method: "POST",
                                success: function(i, j) {
                                    Ext.getBody().unmask();
                                    Ext.ux.Toast.msg("操作信息", "成功删除该数字字典!");
                                    f.getStore().reload();
                                },
                                failure: function(i, j) {
                                    Ext.getBody().unmask();
                                    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");  
    }