rm**********@gmail.com wrote:
In javascript a tree structure node i have a subnode and it has
parentnode and that parentnode has one parent how do i get all parent
node when i click the subnode
var arrayParents = new Array;
if (child.parent) {
var currentParent = child.parent;
arrayParents.push(currentParent);
while(currentParent.parent) {
currentParent = currentParent.parent;
arrayParents.push(currentParent);
}
}
and there you have the array of parents. Adapt this algorithm to your
tree and code