setDefaultStyle toJSON error:TypeError: k.toJSON is not a function

Posted by: 122368177 on 25 April 2020, 10:10 pm EST

  • Posted 25 April 2020, 10:10 pm EST

    events.js?faa1:138 Uncaught TypeError: k.toJSON is not a function

    at w (gc.spread.sheets.all.min.js?29bf:52)

    at a.toJSON (gc.spread.sheets.all.min.js?29bf:52)

    at a.toJSON (gc.spread.sheets.all.min.js?29bf:53)

    at a.toJSON (gc.spread.sheets.all.min.js?29bf:52)

    at a.d.Workbook.toJSON (gc.spread.sheets.all.min.js?29bf:46)

    sheet.suspendPaint()
    sheet.setDefaultStyle(this.defaultStyle as any)
    console.log(this.spread.toJSON()) // TypeError: k.toJSON is not a function
    sheet.resumePaint()
    
  • Posted 27 April 2020, 2:43 am EST

    Hi,

    From the error and code snippet, it seems that “this.defaultStyle” object is not of type “GC.Spread.Sheets.Style”. Please make sure that “this.defaultStyle” object is an instance of GC.Spread.Sheets.Style class and if the issue persists please share a small sample replicating the issue so that we may further investigate the issue and assist you accordingly.

    Regards

    Sharad

Need extra support?

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

Learn More

Forum Channels