- 浏览: 133350 次
- 性别:
- 来自: 北京
文章分类
最新评论
http://blog.flexexamples.com/2008/01/11/displaying-the-number-of-children-in-each-branch-of-a-flex-tree-control/
Displaying the number of children in each branch of a Flex Tree control
by Peter deHaan on January 11, 2008
in Tree
The following example shows how you can display the number of children in each branch of a Tree control in Flex by using the dataDescriptor
property, labelFunction
property, hasChildren()
method and getChildren()
method.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?> <!-- http://blog.flexexamples.com/2008/01/11/displaying-the-number-of-children-in-each-branch-of-a-flex-tree-control/ --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Script> <![CDATA[ private function tree_labelFunc(item:XML):String { var label:String = item.@label; if (tree.dataDescriptor.hasChildren(item)) { label += " (" + tree.dataDescriptor.getChildren(item).length + ")"; } return label; } ]]> </mx:Script> <mx:XML id="treeDP"> <root> <node label="i) One" /> <node label="i) Two" /> <node label="i) Three" /> <node label="i) Four"> <node label="ii) One" /> <node label="ii) Two" /> <node label="ii) Three"> <node label="iii) One" /> <node label="iii) Two" /> </node> <node label="ii) Four" /> </node> <node label="1. Five" /> <node label="1. Six" /> </root> </mx:XML> <mx:Tree id="tree" dataProvider="{treeDP}" labelFunction="tree_labelFunc" showRoot="false" width="200" /> </mx:Application>
发表评论
-
Flex从swf中加载资源和类
2013-12-10 09:37 728需要为直播播放器做几个新的样式,想将每个样式的布局XML和 ... -
swf加载swf的一些问题
2013-03-20 17:31 6871,swfParent 加载 swfChild,如果有交互, ... -
NetStream appendBytes 一点经验
2013-03-20 16:25 2542最近在做基于 NetStream ... -
【译】HTML5还需要什么才能击败Flash(part 2)
2012-04-01 17:53 0What else does HTML5 need to ... -
【译】HTML5还需要什么才能击败Flash(part 1)
2012-04-01 16:36 1057What else does HTML5 need to de ... -
AS 函数作用域、函数闭包、限界方法
2012-03-30 10:21 1433作用域链(scope chain): 任何时候函数开始 ... -
在AS3中自定义全局方法
2012-03-29 11:17 922http://en.flash-ripper.com/2007 ... -
Flex Class object(类对象)构成、traits和prototype
2012-03-29 10:59 1524先贴张图: 每个矩形代表一个对象。CA代表class ... -
使用flex sdk3.6的asdoc遇到的问题及解决方法
2012-03-26 10:24 1901想要对一个组件项目导出asdoc。组件的sdk是3.6,但使用 ... -
UIComponent添加Image不显示
2012-03-18 17:32 988在UIComponent中添加Image组件,图片不显示。 ... -
Flex优化技巧
2012-03-30 09:46 863http://www.jb51.net/article/182 ... -
Flex中多个柱状图和折线图的问题
2012-02-28 17:53 1945做了个柱状图和折线图的混合图表,2根3D的柱子,6根折线,遇到 ... -
AdvancedDatagrid的dataprovider属性
2012-02-22 10:15 781高级dataGrid的dataProvider的set方法里并 ... -
Sprite的宽高设置及Flex组件的混淆
2012-02-02 10:23 1657由于Bitmap和InteractiveObject同级,都继 ... -
Flex SDK3.5 PollingChannel.as 存在内存泄露bug的一种解决方法
2011-12-31 15:32 1263bug见前面的一篇文章: http://xltank.ite ... -
TextInput的ErrorString样式
2011-10-25 13:08 871http://blog.minidx.com/2008/05/ ... -
【转】Flash Player的 mm.cfg文件
2011-10-08 17:17 5157http://jpauclair.net/mm-cfg-sec ... -
Flex trace() 保存路径
2011-10-08 17:11 1057http://help.adobe.com/en_US/fle ... -
给ItemRenderer传参
2011-08-18 17:19 1435给ItemRenderer传递初始参数,可以根据参数灵活生成I ... -
AdvancedDatagrid改变行的颜色
2011-08-16 15:25 1581最早我尝试重写AdvancedDatagrid的drawRow ...
相关推荐
flex中利用tree中的子节点与自定义组件实现的在同一页面中实现导航
Flex Tree 刷新数据源后,重新打开指定节点的解决方案,不需要延迟等其他手段
flex tree 拖拽,flex tree 节点移动。
flex tree 复选框,以及父目录的三种状态。(全部选中,部分选中,没有选中)
flex tree 教程二
本资源中包括Tree的文件和Tree的渲染文件(Checkbox),实现功能为点击树不获取值(也可以获取,改变一个变量即可),只有勾选Checkbox才能得到。并添加到集合中
里面收集了一些Flex的tree控件的用法和实例的源代码
flex tree+checkbox可实现级联勾选
NULL 博文链接:https://zwnjava.iteye.com/blog/603835
flex 修改 tree的icon,根据数据源root 中不同的参数修改不同的图片。
去掉flex tree控件默认的图标并加上线连接。
flex tree 自动显示横向滚动条 自定义重写
flex带复选框的tree,包含源代码,需要用到的朋友请下载
flex tree+checkbox可实现级联勾选 修改后 修改CheckTreeDemoRenderer.as这个文件中 while (!cursor.afterLast){ if (cursor.current.@state == STATE_CHECKED) { noChecks++; }else if (cursor.current.@state =...
项目开发中经常需要展开并选择滚动到特定节点,网上也有很多人发帖求方法,特写了一个满足该需要的demo,供参考。
在原来flex的Tree组件上添加复选框CheckBox
Flex Tree增加虚线连接,绘制虚线连接样式
在网上找到了关于flex 的tree在前面加上checkbox, 我经过改动, 现在很适合使用。
flex中tree和checkbox结合使用的插件,该压缩包包含两个文档,一个是tree和checkbox结合使用的插件,另一个是使用示例
快速定位输入结点名称,点击“检索”后打开树中对应结点