Flex 中非常自定义/水平的树视图
我不确定是否有可能或者在 Adobe Flex 4 中存档以下内容的最佳方式是什么(我对 Flex 3 也很好)。
我需要某种树视图,但项目应该像树一样从上到下放置,而不是像 Flex 框架的树视图实现中那样。为了让这里更清楚,一个简单的“图形”:
1
------------------
2 3
-------- ----------
4 5 6 7
是否可以将 Flex 树视图换成皮肤,使其看起来像我的示例?如果没有,如何创建一个像本机 Flex 组件一样可用的自定义组件(将处理程序附加到每个节点,使其可换肤)并创建如上所述的结构。
I am not sure if it possible or what would be the best way to archive the following in Adobe Flex 4 (I am also fine with Flex 3).
I need some kind of a tree view, but the items should be placed like a tree from top to down and not like it is done in the treeview implementation of the Flex framework. To make it more clear here an simple "graphic":
1
------------------
2 3
-------- ----------
4 5 6 7
Is it possible to skin the Flex tree view to look like my example? If not, how create a custom component that is usable like a native Flex component (attach handlers to every node, make it skinnable) and creates structures like above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这就是所谓的组织结构图! :)))尝试在 google 上搜索 Flex 组织结构图
http://blog.frankula.com/?p= 148
http://coolestflex.blogspot.com/2008/ 10/organization-chart-orgchart.html
this is called org chart! :))) try to google about flex org chart
http://blog.frankula.com/?p=148
http://coolestflex.blogspot.com/2008/10/organization-chart-orgchart.html
这对于 mx:Tree 来说太过弯曲了。设计您自己的控件,可以获得大量经验。想想你想要如何布置节点,如何绘制分支。如果您可以将所有元素放入矩形网格中,那将很容易管理:
决定是否需要可折叠分支、垂直线。将其全部划分为简单的元素,并基于 UIComponent 实现每个元素。在
图形
上画线,从某些框中的标签组成分支。有时,自己进行控制会更好、更干净。我在一天内制作了带有虚拟项目的平滑滚动列表。在此之前,我花了一周时间试图让 Flex List 平滑滚动。
This is too much for mx:Tree to bend like that. Design your own control, it's a great deal of experience to gain. Think out how you want nodes to be laid out, how to draw branches. If you can fit all elements into rectangular grid, that would be easy to manage:
Decide if you need collapsible branches, vertical lines. Divide it all to simple elements and implement each based on UIComponents. Draw lines on
graphics
, compose branches from Labels in some boxes.Sometimes it is much better and clean to make your own control. I made smooth-scrolling list in one day, with virtualized items. Before that, I lost a week trying to make Flex List scroll smoothly.