开发者

Flex Datagrid.tooltip with different text styles

开发者 https://www.devze.com 2022-12-26 16:36 出处:网络
I have a tooltip for each datagrid row. Which is fine. I also can style it with with mx:Style which is great.

I have a tooltip for each datagrid row. Which is fine. I also can style it with with mx:Style which is great.

However, I desire to h开发者_如何学编程ave multiple styles ie a header and the rest of the text in the tooltip. Is this possible? Or to have htmlText for input?


If you need that you should create your own component implementing mx.core.IToolTip and use it to display the tooltip. Write you own handler for toolTipCreate and in this handler set your own component as the tooltip renderer.

        private function createTooltip(e:ToolTipEvent):void {
            //CustomToolTip should extend the Canvas and implement IToolTip 
            var tooltip:CustomToolTip = new CustomToolTip();
            //you need to set the tooltip property in order to make your component used for tooltip renderer
            e.toolTip = tooltip;
        }

        <mx:DataGrid id="myDataGrid" toolTip=" "  toolTipCreate="createToolTip(event)">
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号