【问题标题】:Flex datagrid multiple rows single fileFlex datagrid 多行单文件
【发布时间】:2011-02-21 17:39:21
【问题描述】:
【问题讨论】:
标签:
apache-flex
datagrid
rows
【解决方案1】:
为用户列使用自定义itemRenderer。这是一个示例代码sn-p,您可能需要根据dataProvider的结构对其进行修改
<mx:DataGrid id="dg" width="100%" height="100%" dataProvider="{dp}">
<mx:columns>
<mx:DataGridColumn dataField="image" headerText="Image"/>
<mx:DataGridColumn dataField="user" headerText="User" >
<mx:itemRenderer>
<mx:Component>
<mx:VBox>
<mx:Label text="{data.firstName}"/>
<mx:Label text="{data.lastName}"/>
<mx:Text text="{data.address}"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn dataField="size" headerText="Size"/>
</mx:columns>
</mx:DataGrid>