您好,我这边分析了一下您的数据,发现了影响效率的问题。
表格中含有很多公式,每次执行setArray时都会导致所有公式的重算。
SpreadJS有两个方法,suspendCalcService和resumeCalcService,
分别是挂起运算与恢复运算。我贴一段示例代码,来说明一下具体用法:
- sheet.suspendCalcService(false);
- sheet.suspendPaint();
- sheet.setArray(3, 2, array);
- sheet.resumePaint();
- // 这里的参数一定是false
- sheet.resumeCalcService(false);
复制代码
关于这两个方法的详细用法,请参考API:
http://help.grapecity.com/spread ... endCalcService.html
http://help.grapecity.com/spread ... umeCalcService.html |