Getting Your ItemRenderer to Behave With The DataGrid
This article is from the original REM DEV blog (2008–2010). Some of the technologies it covers (Flex, Flash, AIR, JavaFX 1.x) have since been retired.
The columns that used my ItemRenderer weren't responding to the
'itemClick' event that was set on the DataGrid (but the
columns that weren't using the ItemRenderer WERE responding to it).
So I added this code to my Itemrenderer...
//in the constructor I put this....
this.addEventListener(ListEvent.ITEM_CLICK,handleClick);
//and here's the handler that I added...
private function handleClick(evt:ListEvent):void{
dispatchEvent(evt);
}
I wouldn't be surprised if there is some simple property to set that can overcome this, and I hate add event listeners if I don't have to. So, if anyone out there has some advice, please post a comment.
So I added this code to my Itemrenderer...
//in the constructor I put this....
this.addEventListener(ListEvent.ITEM_CLICK,handleClick);
//and here's the handler that I added...
private function handleClick(evt:ListEvent):void{
dispatchEvent(evt);
}
I wouldn't be surprised if there is some simple property to set that can overcome this, and I hate add event listeners if I don't have to. So, if anyone out there has some advice, please post a comment.