PDA

View Full Version : onmouseover tooltips in grid



shmaltorhbooks
13 Jun 2011, 12:58 AM
Hi,
i adding tooltip to each cell in grid with this code:


{/* come config*/, renderer: function(v, p){
p.attr = "ext:qtip='<a href=http://example.com>link</a>' ext:qtitle='title'"
}}


with option 'ext:hide=false' tooltip not closing on 'mouseover' event, but I need to click somewhere to close tip, and it's uncomfortably

how can i prevent closing qtip on mouseover, but leave closing on some timeout?
thanks:)

diegotdai
13 Jun 2011, 1:35 AM
What you mean tooltip now closing on 'mouseover' event? they should show on mouseover... I'm assuming you want the tooltip to not close on mouseout so the use would have some time to click on the link?



Ext.onReady(function(){
Ext.QuickTips.init();
Ext.apply(Ext.QuickTips.getQuickTip(), {
hideDelay: 10000 // 10 seconds before hiding tip
});
});

shmaltorhbooks
15 Jun 2011, 12:08 AM
quicktip shows on 'mouseover' event of some object
hide by timeout on 'mouseleave' event of that object even if mouse is over quicktip

how can i prevent quicktip closing if cursor over quicktip?

sorry for my english:)

diegotdai
15 Jun 2011, 4:09 AM
closable: true, else you will have to extend it and add the functionality...

shmaltorhbooks
15 Jun 2011, 4:16 AM
Ext.apply(Ext.QuickTips.getQuickTip(), {
hideDelay: 100,
trackMouse: false,
listeners: {
'mouseover': function(){
// some code
},
'mouseleave': function(){
// come code
}
}
});

and it's not working. can you tell me how exactly i must to extend tooltip, to make it's closable after 50ms, but not closable if mouse over it?

skirtle
16 Jun 2011, 4:31 PM
Something like this might work:


Ext.onReady(function() {
var tip = Ext.QuickTips.getQuickTip();

tip.dismissDelay = 0;
tip.hideDelay = 500;

tip.mun(Ext.getDoc(), 'mouseout', tip.onTargetOut, tip);

tip.mon(Ext.getDoc(), 'mouseout', function(ev) {
if (ev.within(tip.getEl(), true)) {
tip.clearTimer('hide');
return;
}

tip.onTargetOut.call(tip, ev);
});
});

It won't hide the tooltip if you mouseover it but it still has problems. When I tried it on a grid I still had problems clicking on the link in the tooltip because trying to move the cursor from one grid cell to the tooltip passed over other grid cells, updating the tooltip.