flex tree grid 综合页面

[quote]
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Style>
Panel{
fontSize:12pt;
}
Tree{
fontSize:12pt;
}
</mx:Style>
<mx:Script>
<![CDATA[
private function ListMailCatelog():void
{
//得到mail_arrclo中的数据
var allArray:Array = mail_arrclo.toArray();

//通过过滤函数滤出符合条件的数据
var curArray:Array = allArray.filter(CateLogFilter);

//设定mail_dg的数据
mail_dg.dataProvider = curArray;
}

private function CateLogFilter(element:* , index:int ,arr:Array):Boolean
{
return (element.Catelog == mail_tree.selectedItem.@data);
}
]]>
</mx:Script>
<mx:ArrayCollection id="mail_arrclo">
<mx:Object>
<mx:Sender>郭靖</mx:Sender>
<mx:Title>升职报告</mx:Title>
<mx:Date>2007-07-07</mx:Date>
<mx:Catelog>Business</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>洪七公</mx:Sender>
<mx:Title>退休报告</mx:Title>
<mx:Date>2007-07-17</mx:Date>
<mx:Catelog>Business</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>黄容</mx:Sender>
<mx:Title>叫花鸡的烹饪过程</mx:Title>
<mx:Date>2007-07-27</mx:Date>
<mx:Catelog>Inbox</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>杨过</mx:Sender>
<mx:Title>残联活动旅游线路</mx:Title>
<mx:Date>2007-07-09</mx:Date>
<mx:Catelog>Inbox</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>韦小宝</mx:Sender>
<mx:Title>阿珂又和建宁打架了:(</mx:Title>
<mx:Date>2007-07-16</mx:Date>
<mx:Catelog>Private</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>虚竹</mx:Sender>
<mx:Title>有空来西夏玩:)</mx:Title>
<mx:Date>2007-07-19</mx:Date>
<mx:Catelog>Private</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>岳不群</mx:Sender>
<mx:Title>求购《避邪剑法》</mx:Title>
<mx:Date>2007-08-18</mx:Date>
<mx:Catelog>Other</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>欧阳峰</mx:Sender>
<mx:Title>出售《九阴真经》</mx:Title>
<mx:Date>2007-09-9</mx:Date>
<mx:Catelog>Other</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>老顽童</mx:Sender>
<mx:Title>蜂蜜优惠15一罐</mx:Title>
<mx:Date>2007-09-18</mx:Date>
<mx:Catelog>Delete</mx:Catelog>
</mx:Object>
<mx:Object>
<mx:Sender>张无忌</mx:Sender>
<mx:Title>明教原始股秘密发售</mx:Title>
<mx:Date>2007-10-1</mx:Date>
<mx:Catelog>Delete</mx:Catelog>
</mx:Object>
</mx:ArrayCollection>
<mx:XML id="treeNode_xml">
<folder label="邮件" data="Mail">
<folder label="收件箱" data="Inbox"/>
<folder label="个人文件夹" data="Inbox">
<Pfolder label="商务信件" data="Business"/>
<Pfolder label="私人信件" data="Private"/>
<Pfolder label="其他" data="Other"/>
</folder>
<folder label="已删除" data="Inbox"/>
</folder>
</mx:XML>
<mx:Panel width="100%" height="100%" horizontalCenter="0" verticalCenter="0"
layout="absolute" title="邮件列表" >
<mx:HDividedBox width="100%" height="100%" horizontalCenter="0" verticalCenter="0">
<mx:Tree id="mail_tree" width="20%" height="100%" dataProvider="{treeNode_xml}"
labelField="@label" showRoot="true" change="ListMailCatelog()">
</mx:Tree>
<mx:DataGrid height="485" id="mail_dg">
<mx:columns>
<mx:DataGridColumn headerText="发件人" dataField="Sender"/>
<mx:DataGridColumn headerText="邮件标题" dataField="Title"/>
<mx:DataGridColumn headerText="日期" dataField="Date"/>
</mx:columns>
</mx:DataGrid>
</mx:HDividedBox>
</mx:Panel>
</mx:Application>
[/quote]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值