File import events

Posted by: mateusz.jagodzinski on 17 March 2021, 8:22 pm EST

    • Post Options:
    • Link

    Posted 17 March 2021, 8:22 pm EST - Updated 3 October 2022, 12:54 am EST

    Hi

    I’m using spreadJS v14.0.6 with React component.

    Through the designer (File → Import; in the ribbon) user has the option to import files.

    I need a way to detect that this file import happened.

    Are there any specific events fired when file import is done?

    If no, in what other way I can detect that workbook has been replaced by a new one from file?

    Best Regards,

    Mateusz

  • Posted 18 March 2021, 6:00 pm EST

    Hi Mateusz

    As of now the designer does not has this event but we have made an enhancement request on your behalf. We will update you on the development of this feature. The internal ID for this issue will be SJS-8049.

    Further as a workaround, you may override the fromJSON method. Please refer to the following code snippet and let us know if you face any issues.

    
    let old = GC.Spread.Sheets.Workbook.prototype.fromJSON;
    
    GC.Spread.Sheets.Workbook.prototype.fromJSON = function() {
      old.apply(this, arguments);
      console.log("JSON as been changed");
      spread = designer.getWorkbook();
     //You could also raise the custom event here
    };
    
    
    

    Regards

    Avinash

  • Posted 15 January 2023, 4:44 pm EST - Updated 15 January 2023, 4:48 pm EST

    I am having the same issue

  • Posted 22 February 2023, 7:20 pm EST

    we have the same issue. Please help

Need extra support?

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

Learn More

Forum Channels