日期:2014-05-16 浏览次数:20703 次
Ext.MessageBox.wait('正在提数据, 请稍侯 ...', '提示');
xxxxFormPanel.getForm().submit({
timeout : 60,
success : function(form, action) {
// 业务成功
Ext.MessageBox.updateProgress(1);
Ext.MessageBox.hide();
},
failure : function(form, action) {
// 业务失败
Ext.MessageBox.updateProgress(1);
Ext.MessageBox.hide();
switch (action.failureType) {
case Ext.form.Action.CLIENT_INVALID :
Ext.Msg.alert('错误!', '存在未通过验证的数据!');
break;
case Ext.form.Action.CONNECT_FAILURE :
Ext.Msg.alert('错误!', '连接错误!');
break;
case Ext.form.Action.SERVER_INVALID :
Ext.Msg.alert('错误!', action.result.msg);
}
}
});
Ext.Ajax.request({
url : ...,
params : {
...
},
success : function(response, opts) {
var o = Ext.util.JSON.decode(response.responseText);
if( o.success){
// 业务执行成功
} else{
// 业务执行失败
}
},
failure : function(response, opts) {
// ? 此处怎么做,大家可以说说 :oops:
}
});
{success:true/false,msg:'xxxx'}