日期:2014-05-16 浏览次数:20352 次
HashMap<String,String> model = new HashMap<String,String>(); model.put("success", "true"); model.put("info", "保存成功"); return new ModelAndView("/app/customer/list",model);
Ext.override(Ext.form.Action.Submit,{ handleResponse : function(response){ var opts = this.options; if(this.form.errorReader){ var rs = this.form.errorReader.read(response); var errors = []; if(rs.records){ for(var i = 0, len = rs.records.length; i < len; i++) { var r = rs.records[i]; errors[i] = r.data; } } if(errors.length < 1){ errors = null; } return { success : rs.success, errors : errors }; } //在options中配置root参数,root:'a.b.c' if(opts.root){ var l = opts.root.split('.'); var o = Ext.decode(response.responseText); Ext.each(l,function(n){ if(o[n]) o=o[n]; }); return o; } return Ext.decode(response.responseText); } });