PDA

View Full Version : Reading nested data from JSON into a store



direct2kali
23 Aug 2012, 2:00 AM
Hi,

I am having a JSON data like below.



{
"divisions":[
{"name": "division1","id": "div1","subdivisions":[
{"name": "Sub1Div1","id": "div1sub1","schemes":[
{"name": "Scheme1","id": "scheme1"},
{"name": "Scheme2","id": "scheme2"}]},
{"name": "Sub2Div1","id": "div1sub2","schemes":[
{"name": "Scheme3","id": "scheme3"}]}

]}]
}

I want to read this in a store. I tried to read this is in a Tree store but am able to achieve that only if all the inner data elements have the same field name.

How can I read and use it in a store in Ext-js4? Any pointers regarding this are welcome.

scottmartin
23 Aug 2012, 6:15 PM
Please review the following for loading nested data:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.reader.Reader

Scott.