爱迪生 发表于 2021-12-30 19:00:30

SpreadJS通过模板完成数据绑定,获取不到数据源

问题:
1.在使用SpreadJS数据绑定功能时,我们通常会使用在线表格编辑器的模板功能,完成数据源绑定
https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0cb07842f31046099f2726d5b27f0e3b~tplv-k3u1fbpfcp-watermark.awebp?
2.获取数据源,发现为null
https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9fe03782288d498ba74defa161adfcf2~tplv-k3u1fbpfcp-watermark.awebp?
解决方法:var person = { 数据1: 'Wang feng' };var source = new GC.Spread.Sheets.Bindings.CellBindingSource(person);designer.getWorkbook().getSheetFromName("Sheet2").setDataSource(source);复制代码https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/fa9610b0802441d6af20a536c8f201d5~tplv-k3u1fbpfcp-watermark.awebp?
再次获取数据源,成功!
https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/cb905552f03e4c7c8337148d7bcb151c~tplv-k3u1fbpfcp-watermark.awebp?





页: [1]
查看完整版本: SpreadJS通过模板完成数据绑定,获取不到数据源