SpreadJS Documentation
toJSON Method
Serialization option that contains the includeBindingSource argument. See the Remarks for more information.
Saves the object state to a JSON string.
Syntax
var instance = new GcSpread.Sheets.Spread(host, options);
var value; // Type: Object
value = instance.toJSON(serializationOption);
function toJSON( 
   serializationOption : Object
) : Object;

Parameters

serializationOption
Serialization option that contains the includeBindingSource argument. See the Remarks for more information.

Return Value

The spreadsheet data.
Example
This example uses the toJSON method.
activeSheet.getCell(0,0).value(123);
var jsonStr = null;
//export
jsonStr = JSON.stringify(spread.toJSON(false));
//import
spread.fromJSON(JSON.parse(jsonStr));
alert(jsonStr);
Remarks

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.

 

See Also

Reference

Spread type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.