表单提交启用xhr2时会丢失所有表单数据
form.submit({
xhr2: true
...
});
源码
...
beforeAjaxSubmit: function(form, options, successFn, failureFn) {
...
if (Ext.feature.has.XHR2 && request.xhr2) {
delete request.form;
formData = request.data = new FormData(form);
if (request.params) {
Ext.iterate(request.params, function(name, value) {
if (Ext.isArray(value)) {
Ext.each(value, function(v) {
formData.append(name, v);
});
}
else {
formData.append(name, value);
}
});
delete request.params;
}
}
...
}
...
...
request: function(options) {
...
requestOptions = me.setOptions(options, options.scope || Ext.global);
request = me.createRequest(options, requestOptions);
return request.start(requestOptions.data);
...
},
...
setOptions: function(options, scope) {
...
data = options.rawData || options.binaryData || options.xmlData || jsonData || null;
...
return {
url: url,
method: method,
data: data || params || null
};
}
...