PDA

View Full Version : [CLOSED] Hide tooltip



gets_gui
Apr 18, 2012, 8:31 PM
Hi,

Just wondering how to hide toolTip in 2.0?
I have code below:


var onBeforeShow = function (toolTip, grid) {
var view = grid.getView(),
record = view.getRecord(toolTip.triggerElement),
data = Ext.encode(record.get('ErrorMessage'));
if (typeof (record) != 'undefined' && record.get('Error') == 'ERROR') {
toolTip.update(data);
} else {
toolTip.hide();
}
};

It looks like the hide() method does not work.
I always got the tooltip.

Vladimir
Apr 18, 2012, 9:23 PM
In the BeforeShow event handler you have to return false to prevent showing
Calling hide method will not affect on showing because in the beforeshow handler a tooltip is still hidden

gets_gui
Apr 19, 2012, 1:15 PM
I did try to return false before I started the first post.
And I even tried the code below, the blank tooltip will always show althought my code returns fasle only.


var onBeforeShow = function (toolTip, grid) {
return false;
};


<ext:ToolTip
ID="rowTip"
runat="server"
XTarget="={#{gridPanel}.getView().el}"
Delegate="={#{gridPanel}.getView().itemSelector}"
TrackMouse="true">
<Listeners>
<BeforeShow Handler="onBeforeShow(this, #{gridPanel});"/>
</Listeners>
</ext:ToolTip>

Vladimir
Apr 19, 2012, 1:26 PM
Hi,

You forgot 'return' in handler


<BeforeShow Handler="return onBeforeShow(this, #{gridPanel});"/>

gets_gui
Apr 19, 2012, 1:45 PM
Sorry about that, it works!