Datagrid Flex component is a very powerful tool to display data. For an enterprise application we're trying to create a tooltip only if the content of the row data is bigger than the width of the row.
We solved the problem using the itemRenderer, but I had some strange behaviours using the itemRollOver.
The itemRollOver is an event of the ListBase class, the base class for controls that represent lists of items that can have one or more selected and can scroll through the items.
This is the MXML code :
<myComp:DataGrid
id="myDG"
dataProvider="{commandList.command}"
itemRollOut="destroyBigTip(event)"
itemRollOver="createBigTip(event)"
editable="true"
width="290"/>
These are the two event handler functions :
public function createBigTip(event:Object):void {
var s:String = "Over"
var label:Label = new Label;
label.text = s;
label.setVisible(true);
label.x = 10;
label.y = 10;
addChild(label);
}
public function destroyBigTip(event:Object):void {
var s:String = "Out"
var label:Label = new Label;
label.text = s;
label.setVisible(true);
label.x = 10;
label.y = 10;
addChild(label);
}
All that works just for the first row of the Datagrid !