bucka
22 Jul 2007, 5:16 PM
Hi.
I want to use only one DataStore to access a complex Xml, instead of using several stores.
My xml:
<areas>
<area>
<AREANAME>a1</AREANAME>
<Procedimentos>
<P>
<NAME>p1</NAME>
</P>
</Procedimentos>
</area>
<area>
<AREANAME>a1</AREANAME>
<Procedimentos>
<P>
<NAME>p1</NAME>
</P>
<P>
<NAME>p2</NAME>
</P>
</Procedimentos>
</area>
</areas>
IS it possible? I can only define one root..so how can i retrieve all 'P' tags?
var ds = new Ext.data.Store({
// load using HTTP
proxy: new Ext.data.HttpProxy({url: 'sheldon.xml'}),
// the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({
// records will have an "Item" tag
record: 'area',
}, [
{name: 'AREANAME', mapping: 'AREANAME'}
])
});
thanks
I want to use only one DataStore to access a complex Xml, instead of using several stores.
My xml:
<areas>
<area>
<AREANAME>a1</AREANAME>
<Procedimentos>
<P>
<NAME>p1</NAME>
</P>
</Procedimentos>
</area>
<area>
<AREANAME>a1</AREANAME>
<Procedimentos>
<P>
<NAME>p1</NAME>
</P>
<P>
<NAME>p2</NAME>
</P>
</Procedimentos>
</area>
</areas>
IS it possible? I can only define one root..so how can i retrieve all 'P' tags?
var ds = new Ext.data.Store({
// load using HTTP
proxy: new Ext.data.HttpProxy({url: 'sheldon.xml'}),
// the return will be XML, so lets set up a reader
reader: new Ext.data.XmlReader({
// records will have an "Item" tag
record: 'area',
}, [
{name: 'AREANAME', mapping: 'AREANAME'}
])
});
thanks