SpreadJS 13
GC.Spread.Sheets Namespace / Worksheet type / getRowCount Method
The sheet area. If this parameter is not given, it defaults to viewport.
In This Topic
    getRowCount Method
    In This Topic
    Gets the row count in the specified sheet area.
    Syntax
    var instance = new GC.Spread.Sheets.Worksheet(name);
    var value; // Type: number
    value = instance.getRowCount(sheetArea);
    function getRowCount( 
       (optional) sheetArea : SheetArea
    ) : number;

    Parameters

    sheetArea
    The sheet area. If this parameter is not given, it defaults to viewport.

    Return Value

    The number of rows.
    Example
    This example gets the row count.
    var count = activeSheet.getRowCount(GC.Spread.Sheets.SheetArea.viewport);
    alert(count);
    This example uses a loop to set the values in cells.
    for (var i = 0; i < sheet.getRowCount(); i++)
      {
        sheet.setValue(i,1, i);
      }
    sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).backColor("Gray");
    sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).foreColor("Red");
    sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).formatter("0.00");
    sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderBottom(new GC.Spread.Sheets.LineBorder("Green", GC.Spread.Sheets.LineStyle.thin));
    sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderTop(new GC.Spread.Sheets.LineBorder("Green",  GC.Spread.Sheets.LineStyle.thin));
    sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderLeft(new GC.Spread.Sheets.LineBorder("Green",  GC.Spread.Sheets.LineStyle.thin));
    sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).borderRight( new GC.Spread.Sheets.LineBorder("Green",  GC.Spread.Sheets.LineStyle.thin));
    sheet.getRange(-1, 1, -1, 1, GC.Spread.Sheets.SheetArea.viewport).font("italic bold 12px/30px arial,sans-serif");
    See Also

    Reference

    Worksheet type