My man A&W had some DataGrid woes. He’s now indoctrinated to the hardest part of Flex / Flash Development: Item Renderers. Adobe deserves credit for making these a lot easier with inline editors and some other nice properties. That doesn’t change the fact that they are f’ing hard and time consuming.
Weirder still is the way you get events from ’em, via event bubbling. Granted, I’m sure rendererIsEditor on the DataGridColumn class works wonders when it works, but at the end of the day, a lot of the itemRenderers and itemEditors you create may need more detail that you want to know about, and bubbling events are a great way to get at that data.
The gist is, you create an itemRenderer class and set one of the DataGrid columns to use it as an itemRenderer. This GUI MXML or ActionScript component emits an event you care about either using the default flash.events.Event class, or one of your own. This event has its bubbles property set to true. As long as its type doesn’t conflict with events the DataGrid is listening for, it’ll bubble up to the form hosting the DataGrid. There is where you handle the event.
The trick is you have to use ActionScript to register for the event because the DataGrid doesn’t know about your custom event; it’s not in its metatags. Therefore, MXML won’t work and AS will.