[CLOSED] Hide tooltip

  1. #1

    [CLOSED] Hide tooltip

    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.
    Last edited by Daniil; Apr 19, 2012 at 3:43 PM. Reason: [CLOSED]
  2. #2
    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
  3. #3
    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>
  4. #4
    Hi,

    You forgot 'return' in handler
    <BeforeShow Handler="return onBeforeShow(this, #{gridPanel});"/>
  5. #5
    Sorry about that, it works!

Similar Threads

  1. [CLOSED] Hide grid tooltip when there is no text
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 25, 2011, 12:16 PM
  2. [CLOSED] GridPanel Cell Tooltip - javascript error on this.hide()
    By iansriley in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 16, 2011, 12:22 PM
  3. [CLOSED] Icon does not hide on item hide
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Nov 09, 2011, 7:13 PM
  4. [CLOSED] gridpanel tooltip
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 30, 2010, 6:58 PM
  5. [CLOSED] label.Hide() does not hide FieldLabel
    By alexp in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 12, 2010, 9:05 PM

Posting Permissions