我有一个显示几列数据的 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 还是其他东西?