ajones86
17 Aug 2007, 2:47 AM
Hi,
I have XML such as the following:
<?xml version="1.0" encoding="UTF-8" ?>
<data type="user" num="85" foo="bar">
<entry>
<name>abolt</name>
<pend>0</pend>
<run>2</run>
<total>2</total>
</entry>
.
.
.
</data>
It is being read into a Grid, using the following data store:
ds: new Ext.data.Store({
sortInfo: { field: 'name', direction: 'ASC' },
reader: new Ext.data.XmlReader({
totalRecords: 'data',
record: 'entry'
}, [
'name',
{name: 'pend', type: 'int'},
{name: 'run', type: 'int'},
{name: 'total', type: 'int'}
])
}),
How would I get the 'foo' attribute, from the top-level XML entity (data)? Would I use the datastore, or the XML reader, or would I need to use the XmlReader to get the raw XML and process it again myself? If I have to do it myself, could I please have some pointers as to where to start? Im still new at this :)
Thanks for your help,
Andrew
I have XML such as the following:
<?xml version="1.0" encoding="UTF-8" ?>
<data type="user" num="85" foo="bar">
<entry>
<name>abolt</name>
<pend>0</pend>
<run>2</run>
<total>2</total>
</entry>
.
.
.
</data>
It is being read into a Grid, using the following data store:
ds: new Ext.data.Store({
sortInfo: { field: 'name', direction: 'ASC' },
reader: new Ext.data.XmlReader({
totalRecords: 'data',
record: 'entry'
}, [
'name',
{name: 'pend', type: 'int'},
{name: 'run', type: 'int'},
{name: 'total', type: 'int'}
])
}),
How would I get the 'foo' attribute, from the top-level XML entity (data)? Would I use the datastore, or the XML reader, or would I need to use the XmlReader to get the raw XML and process it again myself? If I have to do it myself, could I please have some pointers as to where to start? Im still new at this :)
Thanks for your help,
Andrew