SpreadJS Documentation
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 GcSpread.Sheets.Spread($("#ss").get(0),{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);
});

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.