Posted 1 December 2021, 1:17 am EST
Hello Team,
I am facing another issue in SpreadJS.
With some excel files the toJSON function is throwing an error somehow.
I am attaching a zip with a picture of the Browsers error and the excel file i am trying to load.
The steps i am doing:
- i am using the Designer Components to load the excel file, attached to this post
- afterwards i have a Autosave function looking as follows:
function autosave() {
try {
var designer = GC.Spread.Sheets.Designer.findControl(document.getElementById("gc-designer-container"));
var spread = designer.getWorkbook();
var spreadJsonObject = spread.toJSON(false, true, false, false, false);
delete spreadJsonObject.namedStyles;
var jsonObj = JSON.stringify(spreadJsonObject);
$.ajax({
url: '/Home/SaveSpread',
type: 'POST',
dataType: 'json',
cache: true,
data: {
json: jsonObj,
name: user
},
success: function (response) {
if (response) {
notify(dict.notify_autosave_complete[language], "success");
}
}
})
} catch (err) {
var x = err;
}
}
- As soon as the code execute the toJSON function the spread freezes completly. I cant change anything anymore and cant load a different file as long as i dont refresh the page.
This just happens with some specific Excel files and i dont know why. With other files it just works.
I hope you can help me.
Regards
Maik