1. #1
    Ext JS Premium Member
    Join Date
    Aug 2010
    Location
    The Netherlands
    Posts
    93
    Vote Rating
    0
    rkaat is on a distinguished road

      0  

    Default Prevent tooltip from showing

    Prevent tooltip from showing


    Hey,

    I am stuck on this problem where I have a tooltip on specific cells in an EditorGridPanel. When my grid contains data, the tooltip is working fine. But it can happen that my grid doesn't contain data, in that case I show an emptyText. When I hover my mouse over the grid(with no data) I get the following error: this.config[col] is undefined.
    Code:
    getDataIndex : function(col){
        return this.config[col].dataIndex; <-- Error
    }
    //Error on line 45686 in ext-all-debug.js
    The problem is that I show a tooltip based the dataIndex the column has on which my mouse is standing.
    My JS code for doing that is:
    Code:
    beforeshow    : function updateToolTip(tip){
                            var columnIndex = grid.getView().findCellIndex(tip.triggerElement);
                            var rowIndex    = grid.getView().findRowIndex(tip.triggerElement);
                            var dataIndex    = grid.getColumnModel().getDataIndex(columnIndex);
                            
                            // Switch based on dataIndex.
                            switch (dataIndex){
                                case "organisatie":
                                      //Show tooltip
                                      break;
    When my grid is empty I don't want to show a tooltip. How can I prevent this error from showing ?

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,507
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    See if the triggerElement is an empty grid body

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,507
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Or just check what you get back from findCellIndex and findRowIndex. They're probably -1!

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,507
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I just checked for you.

    Both return false if the element does NOT lead to a valid row index or column index.

  5. #5
    Ext JS Premium Member
    Join Date
    Aug 2010
    Location
    The Netherlands
    Posts
    93
    Vote Rating
    0
    rkaat is on a distinguished road

      0  

    Default


    Got it working now, checking if the columnIndex and rowIndex weren't false did the trick,

    Thx for the quick reply,

Similar Threads

  1. interceptTitles failing to prevent default title from showing up
    By wp.joju in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 28 Oct 2011, 5:20 AM
  2. Tooltip not showing on first hover
    By Muhlegg in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 5 Jul 2010, 12:29 AM
  3. extjs tooltip to prevent default tooltip
    By wp.joju in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 1 Jul 2010, 7:43 AM
  4. Prevent Grid header showing ellipsis in Safari
    By FlyFoxUK in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 11 Jun 2010, 6:04 PM

Thread Participants: 1

Tags for this Thread