Custom Function Loading SJS

Posted by: khauam.cardoso on 16 November 2023, 11:19 pm EST

    • Post Options:
    • Link

    Posted 16 November 2023, 11:19 pm EST

    Hello, using custom functions in angular, when I call calculate() to calculate all the formulas, the loading is not appearing, after changing the spread from json to sjs

    Is there any configuration necessary to appear in this case?

    custom.prototype.defaultValue = function () {

    return “loading…”;

    };

  • Posted 19 November 2023, 9:50 pm EST

    Hi,

    I couldn’t understand the exact steps. Could you kindly mention the exact steps you are following? I am not sure what you exactly mean by “after changing the spread from json to sjs”.

    Could you kindly clarify or share a sample replicating the issue so that we could investigate it further?

    Regards,

    Ankit

  • Posted 22 November 2023, 3:27 am EST

    When i use workbook.fromJSON and call calculate() the custom async function shows ** “loading…” ** before the result.

    Now i use workbook.open from zip file and when i call **calculate() ** the numbers calculate without the “loading…” from custom function.

  • Posted 22 November 2023, 8:04 pm EST - Updated 22 November 2023, 8:10 pm EST

    Hi,

    I was unable to replicate the issue at my end. I created a async custom formula and when I call the “calculate” method, it shows the “Loading…” in case of both the “.sjs” file and “json” file.

    Kindly refer to the following sample that I have tested with: https://jscodemine.grapecity.com/share/uBvApJ6_TUKbzFjR7l0CtQ/?IsEmbed=false&Theme=Unset&PreviewDirection=0&IsEditorShow=true&IsExplorerShow=true&IsPreviewShow=true&IsConsoleShow=true&IsRunBTNShow=false&IsResetBTNShow=false&IsOpenInCodemineBTNShow=false&PanelWidth=20&PanelWidth=50&PanelWidth=30&defaultOpen={"OpenedFileName"%3A["%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    Could you kindly share us a minimal working sample replicating the issue so that we could investigate the issue at our end and could assist you accordingly?

    You may also modify the above sample and share it with us. Below is the gif that shows the steps I have followed. If your implementation differs from mine, kindly share a sample.

    Regards,

    Ankit

  • Posted 22 November 2023, 10:41 pm EST

    Thanks, I found where I was going wrong, I need to use spread.calculate(GC.Spread.Sheets.CalculationType.rebuild);

    for loading to appear, only **calculate() ** does not work.

  • Posted 23 November 2023, 4:42 am EST

    Hi,

    We are happy that your issue has been resolved. Yes, for the custom functions to recalculate, you need to pass the Calculation Type “rebuild” as parameter in the calculate method.

    You may refer to the following demo on Calculation Service: https://developer.mescius.com/spreadjs/demos/features/calculation/calc-service/purejs

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels