I have a button inside the DataGrid using ItemRenderer I want to access the button id inside the click handler. How can I do this?
<fx:Script>
public function myButton_clickHandler(event:Event):void
{
Alert.show("My button was clicked!");
}
</fx:Script>
<mx:DataGrid width="100%" height="95%" id="id_variableRefList" >
<mx:columns>
<mx:DataGridColumn id="id_name" dataField=""/>
<mx:DataGridColumn id="id_strip" dataField="">
<mx:itemRenderer>
<fx:Component>
<mx:VBox>
<mx:Button label="My Button" click="outerDocument.myButton_clickHandler(event);" />
</mx:VBox>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
I Want to access the My Button id in the click handler.
I suppose you want Button instance, not the id.
event.targetshould be the Button: