CalcService questions

Posted by: lpagliaro on 19 February 2018, 3:20 pm EST

    • Post Options:
    • Link

    Posted 19 February 2018, 3:20 pm EST

    Hello. I’ve noticed that when using CalcService to suspend calculations, if I execute the line to suspend the service ‘n’ times, then I have to resume it ‘n’ to make it work again.

    You can try it using the console in the developer tools here:

    https://www.grapecity.com/en/demos/spread/JS/InspectorSample/

    calc = spread.getCalcService()
    calc.suspend()
    calc.suspend()
    calc.resume()
    calc.resume()
    

    Is there a reason why this works this way? Is there a way that if calc.suspend() get executed several times, calling calc.resume() once would resume the calculation services?

    When using calc.suspend(), according to its definition in the workbook:

    suspendCalcService(ignoreDirty: boolean): void;

    it says that ignoreDirty specifies whether to invalidate the dependency cells. What does this exactly means. Could you give me an use case to understand what it does?

    I search in the documentation for the definition of the CalcService object but couldn’t find anything, I also searched in GC.Spread.Sheets.d.ts file but there’s nothing related to CalcService. Where can I find its definition?

    Thanks.

    Regards.

  • Posted 21 February 2018, 10:45 am EST

    Hello,

    CalcService’s suspend and resume methods work like a block, you need to resume the service once it is suspended for each block.

    ignoreDirty specfies whether the cells which has the formulas dependent needs to be included while suspending the calculation.

    It is more useful in case of when you have formulas used across sheets and you have suspended the CalcService for a particular sheet.

    Thanks,

    Deepak Sharma

Need extra support?

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

Learn More

Forum Channels