Flex - Disable tooltip on checkbox inside inline renderer on DataGrid?

1.8k views Asked by At

Hi I'm trying to remove the tooltip from the checkbox inside an inline itemrenderer in a datagrid but I still get the tooltip box but with nothing in it. I want the tooltip box removed completely. Here is what I have

<mx:DataGrid dataProvider="{s}" width="80%" id="sdg">
        <mx:columns>
            <mx:DataGridColumn width="14" paddingLeft="2" paddingRight="2" showDataTips="false">
                <mx:itemRenderer>
                    <mx:Component>
                        <mx:CheckBox change="data.selected = !data.selected; dispatchEvent(new Event('clickCheckbox',true,true))" 
                            selectedField="selected" toolTip="{null}"/>
                    </mx:Component>

                </mx:itemRenderer>
            </mx:DataGridColumn>
</mx:columns>
</mx:Datagrid>
2

There are 2 answers

0
shaunhusain On BEST ANSWER

Thanks for the code starting point makes answer these much easier, for the future although I doubt the world will hear this request please include the Flex version your working with since like Android there's a lot of fragmentation out there, here's what worked for me:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                layout="absolute"
                minWidth="955"
                minHeight="600">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
        ]]>
    </mx:Script>
    <mx:DataGrid id="sdg"
                 dataProvider="{new ArrayCollection([{label:'selected',data:{selected:true}},{label:'test',data:{selected:true}},{label:'case',data:{selected:true}}])}"
                 width="50">
        <mx:columns>
            <mx:DataGridColumn width="14"
                               paddingLeft="2"
                               paddingRight="2"
                               showDataTips="false">
                <mx:itemRenderer>
                    <mx:Component>
                        <mx:CheckBox change="data.selected = !data.selected; dispatchEvent(new Event('clickCheckbox',true,true))"
                                     selectedField="selected"
                                     label="{data.label}"
                                     mouseOver="checkbox1_mouseOverHandler(event)">
                            <mx:Script>
                                <![CDATA[
                                    protected function checkbox1_mouseOverHandler(event:MouseEvent):void
                                    {
                                        // TODO Auto-generated method stub
                                        event.stopImmediatePropagation();
                                    }
                                ]]>
                            </mx:Script>
                        </mx:CheckBox>

                    </mx:Component>

                </mx:itemRenderer>
            </mx:DataGridColumn>
        </mx:columns>
    </mx:DataGrid>
</mx:Application>

I added some dummy data in there and had to reduce the size of the grid to make it truncate the checkboxes before it would show the tooltip, then I verified what you posted above that nulling them doesn't work. Above I capture the mouseover event and stop it from propagating up to the ToolTipManager, alternatively you could call ToolTipManager.enable=false then set back to true when appropriate.

0
Timofei Davydik On

I tried your code, and I have no tooltip. You can try ToolTipManager.enabled = false;, but it'll switch off all the tooltips.