Ext.override(Ext.form.Action.Submit, {
processResponse: function(response){
this.response = response;
//增加下面几句代码就OK啦
////////////////////////
var data = response.responseText;
if (data.indexOf('<pre') != -1 || data.indexOf('<PRE') != -1) {
response.responseText = data.substring(data.indexOf('{'), data.length - 6);
this.response = Ext.JSON.decode(response.responseText);
}
///////////////////////////
if (!response.responseText) {
return true;
}
this.result = this.handleResponse(response);
return this.result;
}
});
=========================华丽分割线===================================
这样好像不太好使啊,如果pre标签中有值呢?
这样
Ext.override(Ext.form.Action.Submit, {
processResponse: function(response){
this.response = response;
//增加下面几句代码就OK啦
////////////////////////
var data = response.responseText;
if (data.indexOf('<pre') != -1 || data.indexOf('<PRE') != -1) {
response.responseText =
data.substring(data.indexOf('{'), data.lastIndexOf('}')+1);
this.response = Ext.JSON.decode(response.responseText);
}
///////////////////////////
if (!response.responseText) {
return true;
}
this.result = this.handleResponse(response);
return this.result;
}
});
分享到:
相关推荐
NULL 博文链接:https://fxiaozj.iteye.com/blog/1174901
一个简单的ExtJs4.0搭建环境,利用Ext Ajax的方式提交表单,可使得显示层和控制层完全分开.
本工程为java Web 工程,旨在演示如何提交Extjs 中的表单。 本工程编码方式:UTF-8; 欢迎下载。
保存提交代码,extjs4.0 // 重置 和 保存 按钮. buttons: [{ text: '重置', handler: function() { this.up('form').getForm().reset(); } }, { text: '保存', /*formBind: true, //only enabled once the ...
extjs-form组件配置参数详解 extjs各种组件说明
extjs 表单提交 需 要 注 意 的 事 项
Extjs4 表单从数据库读取数据映射到对应的字段中显示
通过多级的代码来获取组件当中表单元素值的一些技巧
form表单提交后无法进入success函数的问题,很是常见,下面有个不错的解决方法,感兴趣的朋友可以参考下
代码如下: /** * 提交表单 */ function $postForm(a) { if (a.formPanel.getForm().isValid()) { var b = a.scope ? a.scope: this; a.formPanel.getForm().submit({ scope: b, url: a.url, method: “post”, ...
ext form 提交表单介绍 个个属性的介绍 两个函数介绍
ExtJs中表单formPanel的横向布局
参考以前资源,用extJS4.2.1版本做的一个demo示例,希望对大家有用。
NULL 博文链接:https://guoyiqi.iteye.com/blog/324854
ExtJS的表单使用FormPanel容器 表单使用的布局方式:form和formtable布局 ExtJS的表单和html的form标签是相似的,新建一个FormPanel实际上就是新建一个html的form标签,只是添加许多Ext的样式而已
主要用例子说明extjs4的form表单的运用,其中有表单属性说明,表单控件运用说明如: title:'表单', //表单标题 bodyStyle:'padding:5 5 5 5', //表单边距 height:120, //表单高度 width:200, //表单宽度 ...
extjs4 grid 包括form js代码
extjs四种异步提交,非常详细,非常好
extjs,表单学习extjs,表单学习extjs,表单学习extjs,表单学习extjs,表单学习extjs,表单学习extjs,表单学习extjs,表单学习