View Full Version : TreeStore and custom JSON

6 Jul 2012, 4:55 AM
I have a custom JSON structure, which is hirarchical.
The tree is wrapped in an object, that also contains a status code and stuff.

I want to get the "value" content with all its children into the tree, but I encountered a problem.

The first one is, the value object gets parsed and converted into a model instance, but it's children don't. They end up in the "data" section of the model instance, like the other attribute (name, path, etc.)


The Store is configured with an Ajax proxy, that uses an json reader with root: "value".

And this is, what the tree in the store looks like, after it loaded the first nodes:


childNodes: Array[1]

0: constructor

childNodes: Array[0]
data: Object

allowDrag: true
allowDrop: true
checked: null
children: Array[1]

0: Object

children_count_overall: 0
children_page: 1
children_pages: 1
children_pagesize: 10
data: Array[1]
header: Array[4]
name: "KEY_518693"
path: "KEY_518693"

?When I set the root of the proxy to "value" and keep the default rootProperty in the store, I get the root and childnodes, but only if I rename the "children" attribute in the JSON answer to "value".

when I have "value" with "children" with "children" use "value" als root in the proxy and "children" als rootProperty in the treestore it doesn't work.