SpreadJS allows users to fetch the details of the cell values that have been changed in the worksheet by marking the dirty status of the cells. This option provides information on cell modifications but it also causes a lot of performance overhead especially when users need to execute sorting operation on the bulk data.
For performance tuning, it is recommended to use the suspendDirty method and the resumeDirty method.
The suspendDirty method stops SpreadJS from marking the dirty status in the cells until the sorting is complete and the resumeDirty method allows you to restore the dirty status of the cells as and when required. Both of these methods enhance performance to a great extent.
Refer to the following code snippet in order to use suspendDirty method and resumeDirty method in order to improve performance while working with SpreadJS.
JavaScript |
Copy Code
|
---|---|
var startTime, endTime; window.onload = function () { var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); spread.bind(GC.Spread.Sheets.Events.RangeSorting, function (sneder, args) { // Calling suspendDirty() method to stop the marking sorted cells dirty spread.bind(GC.Spread.Sheets.Events.RangeSorted, function (sender, args) { // Calling resumeDirty() method to restore dirty status of cells }; function loadingData(sheet, colInfos, data) function generateData(itemCount) { for (var i = 0; i < itemCount; i++) function generateBindingColumnInfos(colCount) { |