Posted 31 July 2019, 9:04 pm EST
So what I’m doing is:
Step 1 - I create and add custom formula to spreadJS:
spread.addCustomFunction(new ParamDT());
Step 2 - I add manually a custom formula to a cell:
=CustomFormula(1,2,3)
Step 3 - I save the workbook to JSON
let json = spread.toJSON();
Step 4 - I load the json back to a new instance of spreadjs:
spread.fromJSON(json);
Step 5 - I’m not sure if required but I reload a custom function:
spread.addCustomFunction(new ParamDT());
As a result, all previously saved custom formulas in cells display the following error: #NAME?
meaning the function is not defined. Whenever I run recalcAll() function, only custom functions added programmatically (sheet.setFormula(…)) work properly. Manually added custom functions loaded with JSON are ignored.
Can you suggest how to get proper custom functions functionality no matter how I create them?
Thanks!