【发布时间】:2010-11-09 02:27:24
【问题描述】:
我有一个显示几列数据的 DataGrid 组件。它有一个额外的列,显示一个按钮,允许用户对记录执行操作。
<mx:DataGrid dataProvider="{myData}">
<mx:columns>
<mx:DataGridColumn dataField="firstName" headerText="First Name"
width="75" />
<mx:DataGridColumn dataField="LastName" headerText=" Last Name"
width="150" />
<mx:DataGridColumn dataField="phone" headerText="Phone"
width="120" />
<mx:DataGridColumn headerText="" width="110">
<mx:itemRenderer>
<mx:Component>
<mx:Box horizontalAlign="center" width="100%">
<mx:Button label="Take Action" />
</mx:Box>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
我需要在父组件中使用其他可用但与 DataGrid 中的数据无关的数据在父组件中执行操作。
在父组件中捕捉Button点击的最佳方法是什么,并知道它对应的记录是什么?
我应该完全使用自定义事件、itemEditor 还是其他东西?
【问题讨论】:
标签: apache-flex actionscript-3 datagrid button itemrenderer