SpreadJS Documentation
getCellRect Method
GC.Spread.Sheets Namespace > Worksheet type : getCellRect Method
The row index.
The column index.
Index of the row of the viewport: -1 represents column header area, 0 represents frozen row area, 1 represents viewport area, 2 represents trailing frozen row area.
Index of the column of the viewport: -1 represents row header area, 0 represents frozen column area, 1 represents viewport area, 2 represents trailing frozen column area.
Gets the rectangle of the cell.
Syntax
var instance = new GC.Spread.Sheets.Worksheet(name);
var value; // Type: Rect
value = instance.getCellRect(row, col, rowViewportIndex, colViewportIndex);
function getCellRect( 
   row : number,
   col : number,
   rowViewportIndex : number,
   colViewportIndex : number
) : Rect;

Parameters

row
The row index.
col
The column index.
rowViewportIndex
Index of the row of the viewport: -1 represents column header area, 0 represents frozen row area, 1 represents viewport area, 2 represents trailing frozen row area.
colViewportIndex
Index of the column of the viewport: -1 represents row header area, 0 represents frozen column area, 1 represents viewport area, 2 represents trailing frozen column area.

Return Value

Object that contains the size and location of the cell rectangle.
Example
This example uses the getCellRect method.
activeSheet.bind(GC.Spread.Sheets.Events.CellClick, function (e, info) {
               if (info.sheetArea === GC.Spread.Sheets.SheetArea.viewport) {
                   alert("Clicked cell index (" + info.row + "," + info.col + ")");

                   //Acquire the coordinate information of regular cells which exist at the specified index position
                   var cellRect = activeSheet.getCellRect(info.row, info.col);
                   alert("X coordinate:" + cellRect.x);
                   alert("Y coordinate:" + cellRect.y);
                   alert("Cell width:" + cellRect.width);
                   alert("Cell height:" + cellRect.height);
               }
           });
See Also

Reference

Worksheet type