Data Array using Custom Function instead of for just 1 cell

Posted by: dave.welch on 26 February 2021, 7:42 am EST

    • Post Options:
    • Link

    Posted 26 February 2021, 7:42 am EST

    Hi,

    We are using SpreadJS 13.2.

    There is a custom function MYFUNCTION in a cell which gets the value from DB correctly based of the formula.

    Is there anything to get an ARRAY of data (into m*n rows and columns) from DB using the custom Functions instead of for just a cell?

    Please suggest.

    Thanks.

  • Posted 28 February 2021, 11:56 pm EST

    Hi Dave

    You may override the acceptsReference method for the required functionality. Please refer to the following code snippet and attached sample that demonstrate the same.

    
    MyMin.prototype.acceptsReference = function (argIndex) {
        return argIndex === 0 ? true : false;
      };
    
    

    sample: https://codesandbox.io/s/customfunction-forked-t3cmw

    API References:

    acceptsReference: https://www.grapecity.com/spreadjs/docs/v14/online/SpreadJS~GC.Spread.CalcEngine.Functions.Function~acceptsReference.html

    Regards

    Avinash

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels