获取ExtJS中开启Form.fileUpload时,返回的信息

当Form,开启fileUpload后,不能按默认的方式得到action.result,开启fileUpload与否,返回的action.result的内容是不一样的

未开启fileUpload时,返回的action.result不正常的数据对象,包含了返回success,msg等信息

但开启fileUpload后,返回的action.result为布尔数据,相应的数据被包含在了action.response.responseText中,并使用<pre>,,,</pre>进行了包裹

所以,当开启fileUpload后,要得到返回的结果数据,那么需要多做一步操作

var result = Ext.util.JSON.decode(action.response.responseText.substring(5,action.response.responseText.length - 6))
原文地址:https://www.cnblogs.com/dreamcat/p/11417496.html