WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 syncronize the XTREE (Again), nunoguerreiro@netcabo.pt, March 4, 2004

Subject: syncronize the XTREE (Again) From: nunoguerreiro@netcabo.pt Date: March 4, 2004

Hello again Erik:

I found this code in your forum to syncronize two frame with XLOADTREE (XML)

but I don't know how to put it to work.

When I call the  top.frames[1].expandAllAncestors(res) function nothing happens.

Thanks

Nuno Guerreiro

(see bellow)

--------------------------------------------------

function startFind( sText ) {
 var oNode = top.frames[1].webFXTreeHandler.all['webfx-tree-object-4'];
 findNodeText(oNode, sText)
 }
function findNodeText(oNode, sText) {  
 if (oNode.text == sText)     
  return oNode;
        var res;  
 for (var i = 0; i < oNode.childNodes.length; i++)
 {
  res = findNodeText(oNode.childNodes[i], sText);     
  if (res != null)
    autoloadFrame(res);
 }  
 return null;
}


function autoloadFrame(res) {
    top.frames[1].tree.collapseAll();
    top.frames[1].expandAllAncestors(res);
}

I put it in the second frame:

And I put this function:

function expandAllAncestors(oTreeItem) {

if (oTreeItem.parent) {

oTreeItem.parent.expand();

expandAllAncestors(oTreeItem.parent);

}

}

 

and I put this code in xloadtree.js

function expandAllAncestors(oTreeItem) {

if (oTreeItem.parent) {

oTreeItem.parent.expand();

expandAllAncestors(oTreeItem.parent);

}

}




Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX