I have a DataGrid component that displays multiple columns of data. It has another column that displays a button that allows the user to take action on the recording.
<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>
I need to perform an action in the parent component using other data available there, but not related to the data in the DataGrid.
What is the best way to catch a button click in a parent component and find out which record matches?
Should I use a custom event or itemEditor or something else entirely?
source share