Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5
功能
这是一个基础的数据元素容器类。该类转换数据元素成为可视化的元素进行显示。
In the future, DataGroup will support virtualization.
There are several key differences between the DataGroup class and the Group class:
* Group only handles visual elements (GraphicElements + UIComponents). DataGroup can handle can only handle data items (it also handles visual elements that are directly display objects, like UIComponents).
* To manipulate the children in a Group, you should use the content APIs (addElement(), removeElement(), swapElements(), etc...). For a DataGroup, dataProvider is a read-write property typed as an IList. To manipulate the items, you should use the IList APIs defined on the dataProvider.
* DataGroup displays data items, not just visual elements. It maps data items to visual elements through item renderering. Group only displays visual elements.
* DataGroup deals with Spark Virtualization--Group does not.
属性
dataProvider="null"
itemRenderer="null" ,see alse exmaple 1
itemRendererFunction="null" , see alse example 2
typicalItem="null"
事件
rendererAdd="No default"
rendererRemove="No default"
itemRenderer例子
例1:
//declare an string array
//comps.SparkItemRenderer is not changed by spark.skins.default.DefaultItemRenderer, because it uses fx:array
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">
// need to import the item renderers
import spark.skins.default.DefaultItemRenderer;
import spark.skins.default.DefaultComplexItemRenderer;
import spark.components.Button;
public function customItemRendererFunction(item:*):IFactory {
if (item is Button) {
return new ClassFactory(DefaultComplexItemRenderer);
} else {
return new ClassFactory(DefaultItemRenderer);
}
}
]]>
width="75%" height="75%"
horizontalCenter="0" verticalCenter="0">
primitive data 1
primitive data 2
primitive data 3
primitive data string
阅读(7072) | 评论(0) | 转发(0) |