GcSpread.Sheets Namespace > Spread type : toJSON Method |
var instance = new GcSpread.Sheets.Spread(host, options); var value; // Type: Object value = instance.toJSON(serializationOption);
function toJSON( serializationOption : Object ) : Object;
activeSheet.getCell(0,0).value(123); var jsonStr = null; //export jsonStr = JSON.stringify(spread.toJSON(false)); //import spread.fromJSON(JSON.parse(jsonStr)); alert(jsonStr);
SpreadJS serializes the sheet's data source and the table's data source as a cell value if the includeBindingSource argument of the toJSON method is true.
The serializationOption parameter has the following argument:
Argument | Type | Description |
serializationOption.includeBindingSource | Boolean | Whether to include the sheet's data source and the table's data source when the object state is saved to a JSON string. |