This content has been marked as final. Show 6 replies
I know that it would be a pain in going back to the xml document but you might want to put on the file nodes to have the property 'visible = "false"'
Or set the ones that will be the folder to have the property 'isBranch=true' and any of the nodes that don't have that prpperty to have the property visible = 'false'.
But you definately want to look for the isBranch property cause if the isBranch property is set to false then that is what makes the leaves in the Tree Component.
I didn't know about the "visible" property (I don't know much about XML). Knew about isBranch though :)
In fact, I've just tried and the nodes still display even when I put the property visible="false". I couldn't find this property in the documentation. Can you tell me where I can find more information about it ?
I am trying to display folders and files also. Can not get my tree to work.
If you have anything cool I would appreciate to see the way you achieved this.
I am also having the same problem/wanting to do the same thing. I have a custom treeItemRenderer and I want to use it to be able to *not* render the leaf nodes in the tree. I have a way that I can tell if the item being rendered is a leaf or not - but I cannot for the life of me figure out how to not have that item render.
I have tried setting the data property to null - which kind of works in that the label and icon do not show up in the Tree, but the renderer still leaves a large white blank spot in the tree. Then I tried to set the rowheight to zero (I set the variableRowHeight property to true first), but that doesn't seem to make a difference either.
If anyone has any insight into this problem, I would really appreciate it. Even if the insight is, "that's not possible".
The problem you're having is that the by the point you get to the renderer, the tree has already decided what items within the data model it wants to renderer. The ideal solution is to develop a custom class that implements ITreeDataDescriptor. You could probably extend DefaultDataDescriptor and override the isBranch function. The object mentioned should be of type XML and based upon the contents of the XML node, you'd return true/false appropriately.
I myself am on the lookout for a very simple example that shows a custom class that implements ITreeDataDescriptor.
Reading the docs makes it seem difficult, but the same is true of the itemRenderer docs, and simple itemRenderers are pretty easy.
I'll post if I find such an example.