关于flex 4的新数据类型中英文对照

Flex 4 new data type:ArrayList

by Flying 2010.4.15 22:53

There is a new data type: ArrayLis, I wonder if you have known it or not. ArrayList implements IList interface and use Array as its source of the data. Essentially it is a lightweight ArrayCollection, and can be used as source of the data to bind to the control. ArrayCollection can apply sort and filter, but ArrayList can't.

See the following examples:

<?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>

Note that the list based Spark controls can't directly use Array as it's dataProvider, the dataProvider must implement IList interface, which should be one of the reasons to introduce ArrayList

 

不知大家注意到没有,在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数据类 型的原因之一。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值