PDA

View Full Version : Problem with XMLStore



Robert82
3 Feb 2010, 11:29 PM
Hello,

I want to fill my XMLStore with the data attribute. It seems that the Reader recognize the correct data but the store is empty.

My data object looks like in the following way


var data = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Documents>
<Document>
<id>1</id>
<author>
<name>Author1-02</name>
<name>Author2-02</name>
</author>
<title>TestTitle02</title>
<year>122</year>
</Document>
<Document>
<id>0</id>
<author>
<name>Author1</name>
<name>Author2</name>
</author>
<title>TestTitle</title>
<year>12</year>
</Document>
</Documents>';
and the XMLStore looks like this


this.store = new Ext.data.XmlStore({
autoDestroy: true,
storeId: 'myDocStore',
data: documentList, //my method head looks like displayData: function(documentList)
record: 'document',
idProperty: 'id',
fields:[
{name:'id'},
{name:'title'},
{name: 'year'}]
});


Can anyone tell me, what I could do to solve the problem?

Robert82
4 Feb 2010, 1:56 PM
is it possible to use data within the xmlStore?

Robert82
8 Feb 2010, 1:42 AM
It seems that the reader can read the xml, but the store is empty. I have no idea anymore

Eric Blische
4 Apr 2010, 4:04 PM
Is it because the Xml has an element 'Document' (capital D)
but your Reader is looking for 'document' with a li'l d ?