Tooltip on advanced datagrid column in Flex

I have a advanced data grid with columns as status, enabled, owner, name.

I will get data for status as 'applicable' or 'success' or 'failure' . When the status is coming as 'applicable', i have to show the tool tip when move the mouse over there. Can you please help me out how to do it?

Answers


You need to create a GridItemRenderer and here is some sample code to put within the script block of your custom GridItemRenderer:

import mx.controls.ToolTip;
import mx.core.IUIComponent;
import mx.managers.ToolTipManager;

public var applicableToolTip:ToolTip;

private function createToolTip(event:Event):void {
    if (data["status"] == "applicable") {
        var stagePoint:Point = event.target.localToGlobal(new Point(event.target.x, event.target.y));
        applicableToolTip = ToolTipManager.createToolTip(
            "Your applicable message here",
            stagePoint.x,
            stagePoint.y,
            null,
            IUIComponent(event.currentTarget)
        ) as ToolTip;
    }
}

private function destroyToolTip(event : Event) : void {
    if (applicableToolTip != null)
        ToolTipManager.destroyToolTip(applicableToolTip);
}

Then in the label field within the renderer add the attributes rollOver="createToolTip(event)" and rollOut="destroyToolTip(event)"


Need Your Help

Searching inside scala 2.10 ASTs

scala abstract-syntax-tree scala-2.10 parse-tree

What's the best way to recursively search for an element in scala 2.10 ASTs?