特定のセルの位置およびサイズを取得できます。
次のサンプルコードは、セルの位置とサイズを取得します。
| JavaScript |
コードのコピー
|
|---|---|
spread.getActiveSheet().bind(GC.Spread.Sheets.Events.CellClick, function (e, info) {
if(info.sheetArea ===GC.Spread.Sheets.SheetArea.viewport){
console.log("Clicked cell index (" + info.row + "," + info.col + ")");
// 指定のインデックスに位置する標準セルの座標情報を取得します。
var cellRect = spread.getActiveSheet().getCellRect(info.row, info.col);
console.log("X coordinate:" + cellRect.x);
console.log("Y coordinate:" + cellRect.y);
console.log("Cell width:" + cellRect.width);
console.log("Cell height:" + cellRect.height);
}
});
|
|