What you want to do is set the 'dataTipFunction' property on the 
DataGridColumn class to point at your custom function. 

<DataGridColumn ....  showDataTips=true 
dataTipFunction="createCustomToolTip()"

And you'll want to change the declaration of your 
createCustomTooltip to a single item of class Object.  The object 
that will be passed in is the object that represents the target row 
of data in the grid.  You can recast that back into whatever it 
really is inside createCustomTooltip


--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> 
wrote:
>
> You want to look at "dataTip" instead of "toolTip".
> 
> Tracy
> 
>  
> 
> ________________________________
> 
> From: [email protected] 
[mailto:[EMAIL PROTECTED] On
> Behalf Of Steve House
> Sent: Wednesday, January 24, 2007 3:09 PM
> To: FlexCoders
> Subject: [flexcoders] DataGrid Tooltips
> 
>  
> 
> With Flex 2, when the user mouses over a row in a datagrid, I would
> like to show details of that particular row's object in the 
tooltip.
> The datagrid dataProvider is an ArrayCollection of objects with 
many
> properties. Only a few of the properties are shown in the DataGrid.
> 
> I am currently using this to get a custom tool tip...
> 
> (mx:script section)
> private function createCustomTip(title:String, body:String,
> event:ToolTipEvent):void {
> var rtt:RequestToolTip = new RequestToolTip();
> rtt.title = title
> rtt.bodyText = body;
> event.toolTip = rtt;
> }
> 
> <mx:DataGrid id="dgRequestList" dataProvider="{requests}" 
toolTip=" "
> toolTipCreate="createCustomTip('DELETE','Click this button to 
delete
> the report.', event)">
> <mx:columns>
> <mx:DataGridColumn headerText="Id" dataField="iRequestId"
> width="50" /> <mx:DataGridColumn headerText="Title"
> dataField="sRequestTitle" width="300"/>
> </mx:columns>
> </mx:DataGrid>
> 
> For example, these objects also have sRequestDescription properties
> that I would like to show in the tooltip.
> 
> Thanks in advance,
> 
> Steve House
>


Reply via email to