使用数组填充 Flex 中的树
您好,我所需的树结构如下
a -- b -- d
| |
| |
| -- e
-- c
我的字符串数组如下
a/b,c 日/日,日 d/ e
其中 / 之前的组件代表父级,相应父级的子级由 分隔,
任何人都可以为我提供为该层次结构创建数组集合的逻辑,以将其设置为我的树的数据提供者。
感谢和问候
Hi my required tree structure is as follows
a -- b -- d
| |
| |
| -- e
-- c
I have my string array as follows
a/b,c
b/d,e
d/
e
where the component before / represents parent and the children of the corresponding parent are separated by ,
Can anyone provide me the logic to create a array collection for this hierarchy to set as dataprovider to my tree.
Thanks and regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是总体思路。 (我不会输入所有节点)另一种方法是创建一个具有标签和子属性的对象,而不是使用对象动态创建所有这些。希望有帮助。
Here's the general idea. (I'm not going to type all of the nodes out) Another approach is to create an object that has label and children properties rather than creating all of this dynamically with Objects. Hope that helps.