1. #1
    Ext User
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    5
    Vote Rating
    0
    Muhlegg is on a distinguished road

      0  

    Question Tooltip not showing on first hover

    Tooltip not showing on first hover


    I added a simple tooltip to my dataview but can't really get it to work properly. Otherwise it works fine but the tooltip does not show on the first hover, you have to hover a second time to get the tooltip and then it works every time.

    the tooltip trigger, dataview on 'mouseenter'
    PHP Code:
    'mouseenter': {
        
    fn: function(dataViewindexnodee) {
            var 
    record dataView.getRecord(node);  
            
    this.showHoverInfo(record.data);
            
    drawLocation(record.data.lonrecord.data.lat'hover'record.data.id);                    
        },
        
    scopethis

    the tooltip function
    PHP Code:
        showHoverInfo: function(data) {
            
    console.log('img_'+data.filename);
            var 
    target Ext.get('img_'+data.filename);
            
            new 
    Ext.ToolTip({
                
    targettarget,
                
    title'',
                
    autoWidthtrue,
                
    html
                    
    '<div class="img-tooltip">' +
                        
    '<b>' +data.header'</b> by ' +data.username'<br>' +
                    
    '<span class="img-tooltip-desc">' +data.description'</span>' +
                 
    '</div>',
                
    trackMousetrue,
                
    dismissDelay10000,
                
    anchor'right'
            
    });
        } 
    The tooltip function runs every time but it just won't draw the tooltip.

    Any ideas? Probably rather simple solution

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    91
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    A tooltip shows when the mouse enters the target, but you are creating the tooltip when the mouse is already over the target.

    Create the tooltip when the page is created and create it only once (your code would create the tooltip EVERY time the mouse hovers over an item).

    ps. Have you seen Animal's DataTip user extension? That would save you a lot of memory because it only creates one tooltip for the entire dataview.

  3. #3
    Ext User
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    5
    Vote Rating
    0
    Muhlegg is on a distinguished road

      0  

    Default


    Ok thanks, I'll have a look at it.

    EDIT
    Animal's plugin was the perfect solution, thanks again.

Similar Threads

  1. Tooltip on click instead of hover?
    By wez.morris in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 9 Sep 2011, 8:38 AM
  2. Replies: 4
    Last Post: 21 Jan 2010, 9:35 PM
  3. Tooltip not showing up until second passthrough
    By businessman332211 in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 19 Mar 2009, 8:56 AM
  4. [SOLVED]Tooltip on grid row hover
    By y0y in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 15 May 2008, 10:50 AM

Thread Participants: 1

Tags for this Thread