Search code examples
extjs4

Extjs4 how to hide tool tip


I have a chart with tool tip. What i want is when i move the mouse over certain data the tooltip should hide and if i move it on someother data it should display again. My sample code is:

            tips = {
        trackMouse : true,
        width : 120,
        height : 26,
        renderer : function(storeItem, item){
            if(item.yField == 'temp'){
            this.hide();    
            } else{
            this.setTitle(storeItem.get(xFld)+':'+item.value[1]);
            }
        };

I tried hide();, destroy();, disable(); and visibility(); but nothing worked. Can anyone give me the proper solution for this. Thanks


Solution

  • Handle the ToolTip's beforeShow event. Return true if you want the ToolTip to show, false otherwise.

    beforeShow: function(item) {
        return item.yField !== 'temp';
    }