Ext.Ajax.request提交实现waitMsg效果

最近用ExtJs开发过程中,需要使用到等待后台调用cgi执行结束后才做其他操作。。。

本以为需要一个弹窗提示应用成功,但是Ext本身就有一个这样的wait效果,

onApply: function(){ 

  var myMask = new Ext.LoadMask(Ext.getBody(),{msg:"正在应用,请稍后......"});
  myMask.show();
  Ext.Ajax.request({ 

  url: '.........',
  params: {
    param1: 0,
    param2: 1
  },
  method: 'POST',
  success: function(r) {
    var t = Ext.decode(r.responseText);
    if (t.success) {
    me.close();
    window.location.href = '/index.htm';
    }else{
      Ext.MessageBox.alert("............");
    }
  },
  failure: function(form, action){
    Ext.MessageBox.alert(".......");
  },
  scope: this

  });

}

posted @ 2015-03-23 13:00  SunsCheung  阅读(1779)  评论(0编辑  收藏  举报