I think what's happening is that when you pass addTreeNode a single argument it converts that argument itself into a TreeNode, which means any sub-properties that are objects become TreeNodes.  You can avoid this I believe by calling addTreeNode with two arguments, the first being the label that you want to use and the 2nd being the data itself.

 

parentTreeNode.addTreeNode(myobject1.labelField, myobject1);

 

I haven't tested this but that's my guess.

 

Matt

 

-----Original Message-----
From: Steve Pruitt [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 28, 2004 3:21 PM
To: [email protected]
Subject: [flexcoders] tree node filtering

 

Does anyone know of a way to prevent a Tree from displaying items.  I have a situation where it appears the following is

happening:

 

 

__________                 ___________                    ___________

|                |  data obj   |                   |   some var   |                  |

| TreeNode |   ---------->  | myobject1   |   -------------> | myobject2  |

|                |                 |                  |                    |                  |

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

 

 

myobject2 shows up as a node in the tree.  Not sure why this happens.

 

I add myobject1 with: parentTreeNode.addTreeNode(myobject1);

Shouldn't I have to do the same with myobject2 in order for it to be a node?

 

 

-S

 

Reply via email to