1 person found this helpful
You don't actually call events. Events are dispatched, and listener functions are called.
You listen to events in an itemRenderer the exact same way that you would listen to events that are not in an itemRenderer, using addEventListener method.
If you are using a custom itemRenderer that is based on the CheckBox, you can listen and handle the events just like you would normally. However, if you want to call a function int he DataGrid's parent document, things get a bit less easy. You can use outerDocument to call the approprieate listener. But, this will diminish the reuse capabilities of your itemRenderer due tot he external dependency.
You can also listen to the change event on the dataGrid, which should bubble. Do some checking of the target to make sure that the change event was fired from a checkbox.
Thanks for your reply. This is the code that I have-
<mx:DataGridColumn headerText="Favorite" dataField="isFavorite" itemRenderer="mx.controls.CheckBox" />
In this case, how can I listen to the event on the itemRenderer?
Also, if I listen to an event on the DataGrid, how can I capture the target correctly, as what I looking for is to capture the cell (I need both row and column information for the application)