PDA

View Full Version : qtips and grid



wehtam
15 Sep 2010, 11:57 PM
Hello,
I have a grid with a columns with a picture, on this picture I have a function who show a qtips. This function is calling on the onMousOver event.
It's work fine only after the second call of my javascript function.
Have you a solution ?
Thanks
ps : sorry for my very bad english


My code :


function afficheInfo(Elem,Id)
{
// alert('ok');
new Ext.ToolTip({
target: Elem,
title: 'Picture',
width:160,
autoLoad: {url: 'photoProduit.php?id='+Id},
trackMouse:true
});
}

function picture(value,r,record){


return '<a href="javascript:page(\'setArticle.php?id='+record.data.ProductID+'&photo=ok\')"><img src="images/icons/photo.png" border="0" id="img'+record.data.ProductID+'" onMouseOver="javascript:afficheInfo(\'img'+record.data.ProductID+'\','+record.data.ProductID+')"></a>';


}


var cm = new Ext.grid.ColumnModel([{
header: "Picture",
dataIndex: 'PictureID',
width: 40, sortable: false,renderer : picture
}]);

Animal
16 Sep 2010, 12:09 AM
Why don't you just use ONE SINGLE ToolTip Object as documented instead of inlined, INCORRECT event handlers which create a NEW ToolTip on EVERY mouseover event?!

http://dev.sencha.com/deploy/dev/docs/?class=Ext.ToolTip&member=delegate