Flex: CheckBox Tree

效果与功能:

image

1. 简单配置数据源即可实现多层显示
2. 可设定初始选定的项目或目录
3. 获得选定的项目



关于Flex CheckBox Tree的例子有很多, 如:

3 State CheckBox Tree: http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1047969#

CheckBoxTree Component (Adobe Flex 3): http://srirangan.net/?p=56

Flex Checkbox TreeItemRenderer: http://remwebdevelopment.com/dev/a31/Flex-Checkbox-TreeItemRenderer.html

FLEX 构建完美的带有CheckBox三状态的Tree控件: http://blog.csdn.net/cjy37/archive/2009/05/11/4166621.aspx

Flex在Tree控件上添加CheckBox: http://montage.javaeye.com/blog/326302

但上述举例均有一个非常明显的问题: MVC没有分清楚, 是否选定基本上都存储在数据源中, 实际上这只是UI的一个状态, 因此个人认为, 是否选中, 不应该存放于Modeling中. 因此写下面两个类.

image

具体使用方法, 请参考代码.

转载本文或使用代码请注明出处或保留注释中的版权信息.

代码下载: http://www.box.net/shared/q6r915j4qr

This entry was posted in ActionScript, Flex and tagged , , , . Bookmark the permalink.

3 Responses to Flex: CheckBox Tree

  1. Firm says:

    代码下来分析看看

  2. Four eyes says:

    想学flex 教我

  3. ican says:

    我想问,如果只是想在主节点加CheckBox或字节点加CheckBox,怎么加???

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>