SpreadJS Documentation > Sample Code > Sample Code for Rows and Columns > Getting the Displayed Cell Index |
You can get the index of the displayed cell.
This example gets the row and column index.
JavaScript |
Copy Code
|
---|---|
$("#button1").click(function () { var spread = new GcSpread.Sheets.Spread($("#ss").get(0),{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); }); |