0
使用Ext.form.action.Submit()上傳文件時,我得到XML返回結果。ExtJS Xml讀取器錯誤消息
<KeyValuePairOfbooleanstring xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
<key>true</key>
<value>path/to/filename.ext</value>
</KeyValuePairOfbooleanstring>
所以,我想
form.errorReader = Ext.create('Ext.data.reader.Xml', {
success: 'key',
file : 'value'
});
該錯誤消息指出在Reader.js
的Uncaught TypeError: Cannot read property 'prototype' of undefined
任何想法如何改變它接受上述XML格式,並提供了成功和文件值的XmlReader ?
編輯:
我建立了errorReader以這樣的方式,沒有更多的js引發錯誤。但是我仍然不知道如何訪問我的成功處理程序。
form.errorReader = Ext.create('Ext.data.reader.Xml', {
record : 'KeyValuePairOfbooleanstring',
success: 'key',
result: 'value',
model: {
prototype: {
fields:['value']
}
}
});
和成功:
success: function(fp, o) {
alert(o.result); // object object
alert(Object.keys(o.result).join(',')); // success,errors
Ext.getCmp("companyLogo").setSrc=o.result; // does nothing
Ext.Msg.alert('Success', 'Processed file "' + o.response.responseXml + '" on the server'); // undefined
},
我不需要商店的讀者。如果爲真 或「成功:假」,如果假 ,我需要讀者返回像「成功:真」。你的例子沒有,我不知道如何添加,對不起。此外,我的XML沒有多個記錄,只有一個單一的值返回,這是在標籤。 –
Alexander