开发者

How do I set if a node is a branch or a leaf?

开发者 https://www.devze.com 2022-12-31 05:24 出处:网络
I have a tree being populated by an array collection. I don\'t have control of the data in the array collection and even when a node has no children i开发者_Go百科t still has a \"children\" property t

I have a tree being populated by an array collection. I don't have control of the data in the array collection and even when a node has no children i开发者_Go百科t still has a "children" property that is causing my tree to treat every node as branch. I can do a simple check on the length of the array in the children property. If this is 0 I need the tree to display the node as a leaf, no disclosure icon. Any thoughts on how I can achieve this? It would be nice if there were a branchFunction like the iconFunction and labelFunction.

Thanks in advance


There is a dataDescriptor property that allows you to provide a class to determine how nodes and branches are parsed. You will need to implement the ITreeDataDescriptor or ITreeDataDescriptor2 interface.

0

精彩评论

暂无评论...
验证码 换一张
取 消