PDA

View Full Version : add nodes and childnodes to tree



nmohan.025
24 Nov 2010, 1:51 AM
hi...
i need to add parent nodes and child nodes to the existing tree.i'am using appendChild but it is adding only child nodes for an existing node..
so now i need to add fresh nodes and for that child nodes.....anyone knows solution for this problem help me....

Condor
24 Nov 2010, 2:04 AM
OK, so what is the actual problem? You can simply add an entire tree of nodes to the initial root node (just make sure the nodes you are adding to are TreeNodes and not an AsyncTreeNodes).

nmohan.025
24 Nov 2010, 2:25 AM
what i want is i have some nodes and childnodes.....i want to compare these nodes and child nodes with the existing tree nodes and childnodes.if these nodes are existing no need of adding that node just i want update that node with child nodes if not existing...while adding both parent node comparison and childnode comparisons required...give some ideas and concepts to do this.....

Condor
24 Nov 2010, 2:31 AM
Some kind of recursive function that compares two nodes and if not equal, replaces the node, and if equal, calls itself for all child nodes?

nmohan.025
24 Nov 2010, 3:32 AM
hi condor thank you for ur replay..can u specify which function i need to use.....