-
2 Jul 2010 5:27 AM #1
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'
the tooltip functionPHP Code:'mouseenter': {
fn: function(dataView, index, node, e) {
var record = dataView.getRecord(node);
this.showHoverInfo(record.data);
drawLocation(record.data.lon, record.data.lat, 'hover', record.data.id);
},
scope: this
}
The tooltip function runs every time but it just won't draw the tooltip.PHP Code:showHoverInfo: function(data) {
console.log('img_'+data.filename);
var target = Ext.get('img_'+data.filename);
new Ext.ToolTip({
target: target,
title: '',
autoWidth: true,
html:
'<div class="img-tooltip">' +
'<b>' +data.header+ '</b> by ' +data.username+ '<br>' +
'<span class="img-tooltip-desc">' +data.description+ '</span>' +
'</div>',
trackMouse: true,
dismissDelay: 10000,
anchor: 'right'
});
}
Any ideas? Probably rather simple solution
-
2 Jul 2010 5:34 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 41
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.
-
5 Jul 2010 12:29 AM #3
Ok thanks, I'll have a look at it.
EDIT
Animal's plugin was the perfect solution, thanks again.
Similar Threads
-
Tooltip on click instead of hover?
By wez.morris in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 9 Sep 2011, 8:38 AM -
Hi all, My requirement is to apply tooltip to the ComboBox on the hover of the mouse
By Vijaya436 in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 21 Jan 2010, 9:35 PM -
Tooltip not showing up until second passthrough
By businessman332211 in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 19 Mar 2009, 8:56 AM -
[SOLVED]Tooltip on grid row hover
By y0y in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 15 May 2008, 10:50 AM


Reply With Quote