View Full Version : TreeGrid problems

11 Dec 2012, 9:14 AM
Hi, I'm working on a TreeGrid and I'm getting an error when I try retrieve from server a child list when one or more of those childs are in the Tree already.

For example:

A (root)
-> B (child A)
-->D (child B )
--->C (child D)
-> C

When I tried to expand the D node and get a list of children from the server with the node C the grid brokens and C node is never render as child of D.

I will be greatful of any help you can provide.

13 Dec 2012, 7:07 AM
So you have 2 C nodes?

13 Dec 2012, 9:11 AM
Yes, I need to show in the Tree the same node C as Child of 2 other nodes.

13 Dec 2012, 2:16 PM
That is only possible if you fake the two nodes to have different id's. The Ext stores are all build around the idea that id's are unique within the datatype

13 Dec 2012, 2:30 PM
Exactly what I thought... so there is not way to achive that without hacking the component? Are you sure changing ids can do the trick?

14 Dec 2012, 6:19 AM
Yes, different identifiers on both nodes will do the trick. In cases like this there often is a composite key imaginable that can be used to really uniquely a record. For example: parentId + id maybe?

I tend to just concatenate those parts, separated by a dash, and use that as the id. Although, lately I saw something else about composite keys somewhere - no idea where though.