Apache flex FlexDataGrid组件和聚合类
关于Flex/AIR数据网格,我有以下问题: 我可以访问一个聚合对象的变量值作为DataGrid列的数据字段吗 我想要的是:Apache flex FlexDataGrid组件和聚合类,apache-flex,datagrid,air,Apache Flex,Datagrid,Air,关于Flex/AIR数据网格,我有以下问题: 我可以访问一个聚合对象的变量值作为DataGrid列的数据字段吗 我想要的是: 公共A类{ 公共变量id:String; } 公共B级{ 公共var a:a; 公共var值:uint; } items是B的数组集合 根据我在DataGridColumn代码中的阅读和查找,此“a.id”不起作用,因为该值是使用数组语法data[key]从数据对象获取的,我尝试使用自定义项呈现器,但也不起作用 我能得到一些帮助吗?我正在尝试将Flex作为
公共A类{
公共变量id:String;
}
公共B级{
公共var a:a;
公共var值:uint;
}
items是B的数组集合
根据我在DataGridColumn代码中的阅读和查找,此“a.id”不起作用,因为该值是使用数组语法data[key]从数据对象获取的,我尝试使用自定义项呈现器,但也不起作用
我能得到一些帮助吗?我正在尝试将Flex作为家庭项目,我刚刚开始。经过多次尝试,问题得到了解决
<mx:DataGrid id="grid" dataProvider="{items}">
<mx:columns>
<mx:DataGridColumn headerText="aId">
<mx:itemRenderer>
<mx:Component>
<mx:Label text="{data.a.id}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="value" dataField="value"/>
</mx:columns>
</mx:DataGrid>
我还为id字段添加了setter和getter函数,但这对大型类层次结构不起作用。
<mx:DataGrid id="grid" dataProvider="{items}">
<mx:columns>
<mx:DataGridColumn headerText="aId">
<mx:itemRenderer>
<mx:Component>
<mx:Label text="{data.a.id}"/>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="value" dataField="value"/>
</mx:columns>
</mx:DataGrid>