Hi,
thank you for dhtmlxGrid. It’s such a great component.
What we’re trying to do at the moment is to display a small link right of the actual cell.
Is there a posibility to get the exact coordinates of a specific cell (maybe the actual cell) and as well the width and the height for positioning a div layer next to the cell?
Is there a chance to get the exact coordinates in relation to the entire page?
Thank you for your help.
DATASEC
The HTML element of currently selected cell can be taken as
mygrid.cell
if you need to get some cell by coordinates , it may be done as
mygrid.cells(i,j).cell
In such case its dimension can be taken as
mygrid.cell.offsetWidth
mygrid.cell.offsetHeight
There is no direct property to take cell coordinates, but grid has private functionality for such purpose
var pos=grid.getPosition(grid.cell);
or
var pos=grid.getPosition(mygrid.cells(i,j).cell);
The pos is an array
pos[0] - x position relative to document.body
pos[1] - y position relative to document.body
Hi,
thank you very much for this excellent answer. It worked great!
DATASEC