SpreadJS 13
GC.Spread.Sheets Namespace / Worksheet type / getArray Method
The row index.
The column index.
The row count.
The column count.
If true, return formulas; otherwise, return values.
In This Topic
    getArray Method
    In This Topic
    Gets an object array from a specified range of cells.
    Syntax
    var instance = new GC.Spread.Sheets.Worksheet(name);
    var value; // Type: any
    value = instance.getArray(row, column, rowCount, colCount, getFormula);
    function getArray( 
       row : number,
       column : number,
       rowCount : number,
       colCount : number,
       getFormula : boolean
    ) : any;

    Parameters

    row
    The row index.
    column
    The column index.
    rowCount
    The row count.
    colCount
    The column count.
    getFormula
    If true, return formulas; otherwise, return values.

    Return Value

    The object array from the specified range of cells.
    Example
    This example uses the getArray method.
    //set value
    var array = [[1,2,3],[4,5],[6,7,8,9]];
    activeSheet.setArray(1, 2, array);
    //set formula
    var array = [["=1+1","=2+2","=3+3"],["=4+4","=5+5"],["=6+6","=7+7","=8+8","=9+9"]];
    activeSheet.setArray(1, 2, array, true);
    //get value
    var newArray = activeSheet.getArray(1, 2, 3, 4);
    //getformula
    var newArray = activeSheet.getArray(1, 2, 3, 4, true);
    //alert(newArray[0]);
    See Also

    Reference

    Worksheet type