Flex 4中的新数据类型:ArrayList
作者:Flying 日期:2010-04-05
不知大家注意到没有,在Flex 4中的引入了一种新数据类型:ArrayList。它实现了IList接口,底层以Array作为数据源。本质上它是一种轻量级的ArrayCollection,可以作为数据源绑定到控件上。但与ArrayCollection不同的是,它不能筛选和过滤数据。
看下面实例:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<s:ArrayList id="al">
<fx:Object type="Line" class="LineSeries"/>
<fx:Object type="Mountain" class="AreaSeries"/>
<fx:Object type="Candlestick" class="CandlestickSeries"/>
<fx:Object type="HLOC" class="HLOCSeries"/>
</s:ArrayList>
</fx:Declarations>
<s:DropDownList dataProvider="{al}"
labelField="type" selectedIndex="0"/>
</s:Application>
注意,基于list的Spark控件是不能直接以Array作为数据提供者的,一定要实现IList接口。这也应该是引入ArrayList数据类型的原因之一。
上一篇: Flash Builder 4中文版汉化的问题
下一篇: Flex 4中DateTimeAxis的一个Bug
文章来自: 本站原创
Tags: Flex4 Class
相关日志:
评论: 0 | 引用: 0 | 查看次数: -
发表评论

