PDA

View Full Version : Opening a tree branch by clicking on the text instead of the disclosure triangle


you_rock
02-01-2005, 11:19 PM
Please point me in the right direction.

I need for the Tree Component to expand when the text, the icon, or the disclosure triangle is clicked on.

Right now, only the disclosure triangle opens up a branch.

I have tried looking for the Tree.class or looking in the component, but I cannot find where the code is.

Can someone tell me where I can find the code that controls what opens what?

303 maddec
04-15-2005, 10:49 AM
Hi there, just add the following:


myTreeListener=new Object();


myTreeListener.change = function(eventObject){

// the selected node
var theSelectedNode = eventObject.target.selectedNode;

if(_root.myTreeCpn.getIsBranch(theSelectedNode)){

_root.myTreeCpn.setIsOpen (theSelectedNode, true,true);
}
}

_root.myTreeCpn.addEventListener("change", myTreeListener);


Best regards.

maddec

you_rock
05-03-2005, 02:21 PM
Great. Thanks!