Posted 9 December 2020, 1:04 am EST
If you create a custom function and set a table refernce as a parameter an error is thrown. How do I get a reference to the table?
https://codesandbox.io/s/autumn-silence-vy753?file=/src/index.js
Forums Home / Spread / SpreadJS
Posted by: jeff on 9 December 2020, 1:04 am EST
Posted 9 December 2020, 1:04 am EST
If you create a custom function and set a table refernce as a parameter an error is thrown. How do I get a reference to the table?
https://codesandbox.io/s/autumn-silence-vy753?file=/src/index.js
Posted 9 December 2020, 1:06 am EST - Updated 3 October 2022, 10:04 am EST
#Value is returned.

Posted 10 December 2020, 2:45 am EST
Hi Jeff,
This is the expected behavior from the SpreadJS. For accepting the references you need to override the acceptsReference method. Please refer to the following code snippet and attached updated sample that demonstrates the same.
asyncSum.prototype.acceptsReference = function (argIndex) {
return argIndex === 0 ? true : false;
};
sample: https://codesandbox.io/s/sharp-hooks-6ki46?file=/src/index.js:2169-2275
API refereces:
acceptsReference: https://www.grapecity.com/spreadjs/docs/v14/online/SpreadJS~GC.Spread.CalcEngine.Functions.Function~acceptsReference.html
Regards
Avinash