Describe the bug
Uncaught TypeError: Cannot read property '0' of undefined
at Object.Xh [as setCellValue] (api.js:103)
at HTMLDocument. (base.js:19)
at i (plugin.js:1)
at Object.fireWith [as resolveWith] (plugin.js:1)
at Function.ready (plugin.js:1)
at HTMLDocument.D (plugin.js:1)
To Reproduce
- The first step: initial luckysheet
- The second step: luckysheet.getSheet({"index": 0, "name": "Sheet1"});
- The third step: luckysheet.setCellValue(0,0, "test");
- See error: Uncaught TypeError: Cannot read property '0' of undefined
What is expected?
it would update the A1 value as "test" string.
Screenshots or demo
the same as the above error
Environment
- OS: MAC OS
- Browser Version: Chrome Version 131 (Official Build) (x86_64)
- Luckysheet Version: 2.1.13
Additional context
Could you please look into this bug, this is a very critical bug.
thank you
Best,
Jinyu Chen
3条答案
按热度按时间eh57zj3b1#
could you let me know which version can call the setCellValue() successful?
thank you
knsnq2tg2#
@Chenjinyu
我也遇到了这个问题,但是我在页面上等整个luckysheet加载完之后,在console里手动执行这行代码就可以work了。
我怀疑是代码执行到这里的时候sheet还没加载完
5uzkadbs3#
@Chenjinyu
在hook里面调用window.luckysheet.setCellValue()就行了。