Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3334595
  • 博文数量: 530
  • 博客积分: 13360
  • 博客等级: 上将
  • 技术积分: 5473
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-13 13:32
文章分类

全部博文(530)

文章存档

2017年(1)

2015年(2)

2013年(24)

2012年(20)

2011年(97)

2010年(240)

2009年(117)

2008年(12)

2007年(8)

2006年(9)

分类:

2009-09-01 18:10:16

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) |
给主人留下些什么吧!~~