This samples show how you can repaint the worksheet and use suspendPaint and resumePaint function to speed up the rendering performance.
After the user changes the sheet, the Spread component needs to deal with these changes and paint a new sheet.
You can use the repaint method to repaint the sheet.
var spread = GC.Spread.Sheets.findControl(document.getElementById('ss')); var sheet = spread.getActiveSheet(); sheet.repaint();
Most of the time, after you change the sheet, the component will auto refresh to respond to the changes. If you make a lot of changes at one time, but don't want the sheet to repaint many times, then you can use the suspendPaint method to stop the automatic repaint until the changes are complete. Then call the resumePaint method to redraw the sheet, as shown in the following example:
var spread = GC.Spread.Sheets.findControl(document.getElementById('ss')); var sheet = spread.getActiveSheet(); sheet.suspendPaint(); sheet.setValue(2, 2, 'Click me and input a char by keyboard!'); sheet.addSpan(2, 2, 1, 5); sheet.setValue(4, 2, 'Double click the black empty cell!'); sheet.addSpan(4, 2, 1, 5); //... sheet.resumePaint();