PDA

View Full Version : load xml into treestore



Siriru
19 Jun 2012, 8:13 AM
hello,

I need to load data into my treestore. My ajax request give me XML data without leaf and text attribute. How I can map them ?



<items>
<item>mytext</item>
<item>mytext2</item>
...
</items>


I know for leaf property but for text I tried mapping in my model:


fields: [
{ name: 'leaf' , type: 'boolean' , defaultValue: true } ,
{ name: 'text', mapping: 'item'},
]

and the reader in my proxy store:


reader: { type: 'xml',root: 'items' , record: 'item' } ,

I have all the nodes but without text =/

Please help me !

-Siriru

Siriru
19 Jun 2012, 11:05 PM
please help !

Siriru
20 Jun 2012, 1:43 AM
answer :



fields: [
{ name: 'leaf' , type: 'boolean' , defaultValue: true } ,
{ name: 'text', mapping: '/'}
]