PDA

View Full Version : Grid cell tooltip



mmarti
11 May 2010, 10:20 PM
Hi all,

Does anybody know, if it's possible to show the tooltip from the plugin CellToolTips above the mouse cursor?

Thanks for any help.

Best regards

Mike

mmarti
11 May 2010, 11:51 PM
Found a solution:

Ext.override(Ext.ToolTip,{

adjustPosition : function(x, y){

// do not position outside the Window
var cw = document.documentElement.clientWidth-5;
var ch = document.documentElement.clientHeight-5;
var bw = this.body.getTextWidth();
if(this.title) bw = Math.max(bw, this.header.child('span').getTextWidth(this.title));
bw += this.getFrameWidth() + (this.closable ? 20 : 0) + this.body.getPadding("lr");
var bh = this.getInnerHeight() + this.getFrameHeight() + this.body.getPadding("tb");
if(x + bw > cw) x = cw - bw;
if(y + bh > ch) y = ch - bh;

// do not position under mousecursor
var ay = this.targetXY[1], h = this.getSize().height;
if(this.constrainPosition && y <= ay && (y+h) >= ay){
y = ay-h-5;
}

return {x : x, y: y};
}
});

Regards

Mike

Animal
11 May 2010, 11:54 PM
The solution? You "found" it?

The thread below this one???????