Hi Jose,
We have reviewed your query
and understand that you wish to save and open data as a JSON object in our
Spreadsheet component. This functionality can be achieved
using the openFromJson
and saveAsJson
methods.
The saveAsJson
method saves the entire Spreadsheet data as a JSON object, capturing all
features used within the Spreadsheet. The openFromJson
method loads this saved JSON data back into the Spreadsheet.
To demonstrate, we have prepared a sample that saves the Spreadsheet
data as JSON using the saveAsJson
method and then opens it with the openFromJson
method upon a button click. For your reference, we have included the sample and a code snippet below.
saveJson()
{
this.spreadsheetObj.saveAsJson().then((result)
=> {
this.json = result;
console.log(this.json);
})
}
openJson()
{
this.spreadsheetObj.openFromJson({file:
this.json.jsonObject});
}
|
Sample link: Odusd3
(forked) - StackBlitz
For more information,
please refer the below documentation,
https://ej2.syncfusion.com/angular/documentation/spreadsheet/open-save#configure-json-deserialization-options
https://ej2.syncfusion.com/angular/documentation/spreadsheet/open-save#configure-json-serialization-options
Kindly check the above
shared details and get back to us if you need further clarifications.