Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Steve Schreiner on Sep 26, 2008 08:34
open dhtmlx forum
find position of grid row

Attaching to the grid OnMouseOver event, I would like to determine the row that I am hovering over and then calculate the right edge and top edge x,y position of the row, so that I can move a floating div to align with the row as I mouseover the row. How can I do this?
Answer posted by Support on Sep 29, 2008 16:59
onMouseOver event provides row ID and cell index  for cell other which mouse hovered
You can get its position as
var data = grid.getPosition(grid.cells(id,ind).cell);
var x = data[0]
var y = data[1]

The alternative solution - redefine existing method as

//need to be executed before grid creation
mygrid.prototype._drawTooltip=function(e){
    //custom code here
    // e - DOM event object, which has info about coordinates 
}