PDA

View Full Version : Tree Node repeating



bevara.siva
18 Aug 2014, 1:21 AM
Hi,
We are using Ext Js 4.2.x.

We have problem loading the JSON object to Tree panel. We get the JSON object from the WCF service.
I have created a sample with the returned data from the service in the fiddle.

https://fiddle.sencha.com/#fiddle/91t

Please help!!

Regards,
SivaPrasad.B

fmoseley
19 Aug 2014, 7:41 PM
It's the format of your data. The docs state: (http://docs.sencha.com/extjs/5.0/apidocs/#!/api/Ext.data.TreeStore)


Reading Nested Data
For the tree to read nested data, the Ext.data.reader.Reader must be configured with a root property, so the reader can find nested data for each node (if a root is not specified, it will default to 'children'). This will tell the tree to look for any nested tree nodes by the same keyword, i.e., 'children'. If a root is specified in the config make sure that any nested nodes with children have the same name. Note that setting defaultRootProperty accomplishes the same thing.

Check out the following fiddle. (https://fiddle.sencha.com/#fiddle/95n)