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>
그래서 나는 오류 메시지가 Reader.js
에서Uncaught TypeError: Cannot read property 'prototype' of undefined
는 상기 XML 형식을 받아 성공과 파일의 값을 제공하는 XmlReader를 변경하는 방법을 어떤 아이디어 상태
form.errorReader = Ext.create('Ext.data.reader.Xml', {
success: 'key',
file : 'value'
});
시도 ?
편집 :
내가 JS 더 이상 오류가 발생되는 방식으로 errorReader을 만들었습니다. 하지만 여전히 내 성공 처리기에서에 액세스하는 방법을 찾지 못했습니다.
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
},
저는 매장 용 리더가 필요하지 않습니다.이 참일 경우 또는 "성공 : 거짓"인 경우 거짓 인 경우 과 같이 "성공 : 참"과 같이 sth을 반환해야합니다. 당신의 모범이 아니며, 나는 어떻게 추가할지, 미안하다. 또한 내 xml에는 복수 레코드가 없으며 반환 할 단일 값은 태그입니다. –
Alexander