我有一个DataGrid组件显示几列数据。它有一个额外的列,显示一个按钮,允许用户对记录采取行动。如何知道Flex DataGrid itemRenderer中的按钮何时被点击?
<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中的数据无关。
什么是捕获父组件中的按钮点击的最佳方式,并知道它对应的记录是什么?
我应该使用自定义事件,还是itemEditor或其他东西?