SpreadJS Documentation
Setting Cell Values
SpreadJS Documentation > Sample Code > Sample Code for Cells > Setting Cell Values

You can put values in the cells.

Using Code

This example sets cell values.

JavaScript
Copy Code
$(document).ready(function () {
    var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
    var sheet = spread.getActiveSheet();
    sheet.getCell(0, 0).formatter("0.00_);(0.00)");
    sheet.getCell(1, 0).formatter("0.00_);(0.00)");
    sheet.getCell(0, 1).formatter("0.00_);(0.00)");
    sheet.getCell(1, 1).formatter("0.00_);(0.00)");

    //Set values to Text property
    sheet.getCell(0, 0).text("10");
    //Set values by calling SetText method
    sheet.setText(1, 0, "10");

    //Set values to Value property.
    sheet.getCell(0, 1).value(10);
    //Set values by calling SetValue method.
    sheet.setValue(1, 1, 10);
});