Posted 8 September 2017, 9:42 am EST
Hi,
The data in SpreadJS is stored locally unless you’ve implemented saving and retrieving of data from the server.
To loop through the cells, you can use the $.wijmo.wijspread.Sheet.getCells() method and get the value of each cell using the getValue() method as below :
[js]var spread = $(“#spreadContainer”).wijspread(“spread”);
var sheet = spread.getActiveSheet();
var cells = sheet.getCells(5, 3, 7, 6);
var values;
for (var i = cells.row; i < cells.row2; i++) {
for (var j = cells.col; j < cells.col2; j++) {
values = values + sheet.getValue(i, j) + ",";
}
}[/js]
You can then perform calculations on the retrieved values.
To change the data in certain cells, you can use the setValue() method as below :
[js]var spread = $("#spreadContainer").wijspread("spread");
var sheet = spread.getActiveSheet();
var total = sheet.getValue(1, 1) + sheet.getValue(2, 1) + sheet.getValue(3, 1);
sheet.setValue(4, 0, "total");
sheet.setValue(4, 1, total);[/js]
Hope it helps
Regards
Abdias