重写表单提交方法,
Ext.override(Ext.form.Action.Submit,{
// privateprocessResponse : function(response){
this.response = response;
//增加下面几句代码就OK啦
////////////////////////
var data = response.responseText;
if(data.indexOf('<pre>') != -1) {
response.responseText = data.substring(5, data.length-6);
this.response = Ext.util.JSON.decode(response.responseText);
}
///////////////////////////
if(!response.responseText){
return true;
}
this.result = this.handleResponse(response);
return this.result;
}
});
本文介绍如何在ExtJS中重写表单提交的方法,通过修改`Ext.form.Action.Submit`来处理响应文本,移除预格式化标签并解析JSON响应。


被折叠的 条评论
为什么被折叠?



