Can incrementalLoading cause issue with calling sheet.tag() function?

Posted by: marek.bujdoso on 19 September 2022, 1:39 am EST

  • Posted 19 September 2022, 1:39 am EST

    In our case, we use incrementalLoading in ```

    spread.fromJSON()

    
    In sheet.tag we store object with sheet id ```
    { id: "some id"}
    ``` and onSave we need to gather all the existing ids from tags. 
    

    sheet.tag().id

    
    There is a situation where the tag() function fails with an error:
    [i]Cannot read properties of null (reading 'getValueForKey')
        at e.tag (gc.spread.sheets.all.min.js:35:7304)[/i]
    
    When I remove incremental loading it is working fine. 
    Can you explain when such an error occurs?
    
    I need the incremental loading there...
  • Posted 19 September 2022, 9:28 pm EST - Updated 3 October 2022, 12:01 am EST

    Hi Marek,

    It seems like you are not getting/setting the tags correctly. For setting the tag at sheet level, use Sheet.tag(“id:someId”) . The code snippet that you shared uses sheet.tag().id which is not correct. You should use Sheet.tag() to get the saved tag and then parse it to get the value of the id.

    For getting/setting the tag at cell level, you can use Sheet.getTag(row, col, sheetArea?) or Sheet.setTag(row, col, tag, sheetArea?)

    For example, you can refer to the following sample that I have created for you: https://jscodemine.grapecity.com/share/d5hsS2LT9EWN1Q6gj7ZMJg/

    Tags Demo: https://www.grapecity.com/spreadjs/demos/features/cells/tags/tag-basic/purejs

    If the issue still persists at your end, please share a working sample replicating the issue so that we can investigate it at our end and could assist you accordingly.

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels