I have this code. I want to add Buttons in the second column of the data grird.
<mx:DataGrid width="100%" height="95%" id="id_variableRefList" >
<mx:columns>
<mx:DataGridColumn id="id_name" dataField=""/>
<mx:DataGridColumn id="id_strip" dataField="">
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
How can I add buttons in second column using an ItemRenderer?
There are many ways you can do this.
You could use an inline itemRenderer like so:
Or you could create a custom component and set the
itemRendererproperty of theDataGridColumn.UPDATE:
To get the id of the button that was clicked, you can use the
currentTargetproperty of theeventthat gets passed to youreventListener.