arigs
asked on
tooltip flex4
Hi Experts,
here is my problem, I need to display a tooltip in a particular column of advanceddatagrid. The thing is when we mouse over any value of that column we need to dispaly that corresponding value as tooltip. Thx in advance...
here is my problem, I need to display a tooltip in a particular column of advanceddatagrid. The thing is when we mouse over any value of that column we need to dispaly that corresponding value as tooltip. Thx in advance...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here is simple example for you with custom tooltip
Although this one was written for DataGrid.
Same techniques works for AdvancedDataGrid
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="doInit();">
<mx:Script>
<!![CDATA[import mx.collections.ArrayCollec tion; // this holds the grid data
[Bindable]
private var myData:ArrayCollection = new ArrayCollection();private function doInit():void{
myData.addItem({fname:"Joe ",lname:"B loggs"});
myData.addItem({fname:"Joe 1",lname:" Bloggs"});
}
private function buildToolTip(item:Object): String{
var myString:String = "";
if(item != null)
{
myString = myString + "Firstname : " + item.fname + "\n";
myString = myString + "Lastname : " + item.lname + "\n"
}
return myString;
}
]]>
</mx:Script>
<mx:DataGrid id="dGrid" dataProvider="{myData}" visible="true" dataTipFunction="buildTool Tip">
<mx:columns>
<mx:DataGridColumn dataField="fname" headerText="FirstName" showDataTips="true" />
<mx:DataGridColumn dataField="lname" headerText="LastName" showDataTips="true" />
</mx:columns>
</mx:DataGrid>
</mx:Application>
Although this one was written for DataGrid.
Same techniques works for AdvancedDataGrid
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="doInit();">
<mx:Script>
<!![CDATA[import mx.collections.ArrayCollec
[Bindable]
private var myData:ArrayCollection = new ArrayCollection();private function doInit():void{
myData.addItem({fname:"Joe
myData.addItem({fname:"Joe
}
private function buildToolTip(item:Object):
var myString:String = "";
if(item != null)
{
myString = myString + "Firstname : " + item.fname + "\n";
myString = myString + "Lastname : " + item.lname + "\n"
}
return myString;
}
]]>
</mx:Script>
<mx:DataGrid id="dGrid" dataProvider="{myData}" visible="true" dataTipFunction="buildTool
<mx:columns>
<mx:DataGridColumn dataField="fname" headerText="FirstName" showDataTips="true" />
<mx:DataGridColumn dataField="lname" headerText="LastName" showDataTips="true" />
</mx:columns>
</mx:DataGrid>
</mx:Application>
ASKER
that link was helpful
ASKER
@pravinasar:
Thx for ur help
Thx for ur help
showDataTips="true"