I'm new to Flex so this might be more of an ambitious first project then I can
handle but I feel close, just not close enough...
I have a datagrid which displays either an image of a key or an empty image
depending on a value in the row data. If the key image is displayed then I'd
like the image's tooltip to read "Locked by xxx" where xxx comes from the
object in the current row.
I have the image switching working using an itemRenderer of type Image and a
labelFunction that returns the name of the file for the correct image, but I
cannot a way to pass the tooltip message into the Image.
private function getModeratorLockImage(o:Object, c:DataGridColumn):String {
if (o.moderatorId == null)
return "assets/blank.png";
else
return "assets/key.png";
}
<mx:DataGridColumn width="40" sortable="false"
itemRenderer="components.ModeratorLockColumn"
labelFunction="getModeratorLockImage" />
One thought was to create a custom component of type Image and pass the tooltip
info to it but no where do I see a way to capture the current row and pass it
to the custom component.
Maybe there's an event hookup that would work? Or maybe I'm overlooking
something obvious.
Any help appreciated,
Thanks
Paul