Spread.Sheets Documentation
Getting the Displayed Cell Index
Spread.Sheets Documentation > Sample Code > Sample Code for Rows and Columns > Getting the Displayed Cell Index

You can get the index of the displayed cell.

Using Code

This example gets the row and column index.

JavaScript
Copy Code
$("#button1").click(function () {
    var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
    var sheet = spread.getActiveSheet();

    //Acquire top row (column) index
    var topRow = sheet.getViewportTopRow(1);
    var leftCol = sheet.getViewportLeftColumn(1);

    alert("Index of top row being displayed: " + topRow + "\n" +
        "Index of first column being displayed: " + leftCol);
});