PDA

View Full Version : How to use mouseover event in grid cell



AiAcc
27 Dec 2011, 2:10 AM
Hi All:

when mouseover on the grid cell or column , I want to show a tooltip and use ajax load data ,but I don't find mouseover event in Ext4.
How can I know which cell the mouserover on ?
I only find itemmouseenter event. but it will fire event when i over on the one row .here is my code:


grid.getView().on('itemmouseenter', function(view,record,item,index,e) {
view.tip = Ext.create('Ext.tip.ToolTip', {
target : e.target,
loader : {
url : url,
renderer: 'data'
},
tpl : cQtipTpl,
listeners: {
beforeshow: function updateTipBody(tip, opts) {
tip.getLoader().load({
params: {}
});
}
}
});
});

mitchellsimoens
27 Dec 2011, 7:21 AM
A better way is to use a renderer in the columns you want a tooltip and use the attribute data-qtip on the element and if you have quicktips init'd then it should pick it up automatically.

AiAcc
27 Dec 2011, 8:16 AM
A better way is to use a renderer in the columns you want a tooltip and use the attribute data-qtip on the element and if you have quicktips init'd then it should pick it up automatically.

I user the renderer and return return '<div data-qtip="' + qtip +'">' + value + '</div>'; on the column ,it's easy to use with local data.

But I don't know how to load data by ajax with it

mitchellsimoens
27 Dec 2011, 8:32 AM
To be honest, that's not that great of an idea. How long will the Ajax take versus how long will the user hold his/her mouse over the same target?

AiAcc
27 Dec 2011, 5:15 PM
To be honest, that's not that great of an idea. How long will the Ajax take versus how long will the user hold his/her mouse over the same target?

The customer need it.:(

AiAcc
29 Dec 2011, 12:43 AM
Does anyone know this? Thank you a lot.