SpreadJS Documentation
getArray Method
The row index.
The column index.
The row count.
The column count.
If true, return formulas; otherwise, return values.
Gets an object array from a specified range of cells.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var value; // Type: Array
value = instance.getArray(row, column, rowCount, colCount, getFormula);
function getArray( 
   row : number,
   column : number,
   rowCount : number,
   colCount : number,
   getFormula : boolean
) : Array;

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

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.