Posted 14 April 2020, 3:58 pm EST
I would like to keep the undo commands in a sheet in the toJSON object. Is this possible?
Forums Home / Spread / SpreadJS
Posted by: jeff on 14 April 2020, 3:58 pm EST
Posted 14 April 2020, 3:58 pm EST
I would like to keep the undo commands in a sheet in the toJSON object. Is this possible?
Posted 15 April 2020, 10:02 am EST
Hi Jeff,
If I understand correctly what you need to do is export the custom command to JSON. We are sorry but this feature is not supported by SpreadJS.
Could you please explain more about your use case that why you need to serialize the custom commands to json?
Regards
Sharad
Posted 16 April 2020, 7:33 pm EST
Sharad,
I’m trying to push updates to spread JS through web sockets. The “spread.fromJSON” is great at updating the sheet with a new state. Unfortunately it kills the Undo history for a user. Is it possible to persist the undo history after the fromJSON?
Posted 17 April 2020, 4:06 am EST
Hi Jeff,
We are sorry but it is not possible to persist the undo history after the fromJSON(). As you mentioned fromJSON updates the workbook with the new state and there is no guarantee that the undo operations of the previous state would be valid for the new state too so it is a technical limitation.
If you are updating the spreadJS in real time, consider updating only the required parts like if you need to add chart then create a custom command to add chart and execute the command to add a chart, in this way, you would be able to preserve the undo stack while making real-time updates.
Posted 19 April 2020, 5:41 pm EST
That makes sense. That pattern is required for my particular need. Thats for quick response.
Posted 5 July 2020, 9:23 pm EST
Sharad does Spreadjs support realtime collaboration? Is this part of future plans?
Posted 6 July 2020, 2:49 am EST
We are sorry but for now, spreadJS do not provide any inbuilt support for collaboration. Further, I’ve asked the PMs to confirm if this is something we are considering for further releases and will update you as soon as I get more information regarding the same.
Posted 8 July 2020, 12:59 am EST
The PM has informed us that we are currently researching about the collaboration feature and would have information in a few months. So yes, it is being considered for future releases but we do not have ETA for the same.