Spread.Sheets Documentation
clearValues Field
Represents the command used to clear cell values on a worksheet.
* The command has a boolean field canUndo that indicates whether the command supports undo and redo operations, and an execute method that performs an execute or undo operation.
* The arguments of the execute method are as follows.
context {GC.Spread.Sheets.Workbook} The context of the operation.
options {Object} The options of the operation.
* options.sheetName {string} The sheet name.
* options.ranges {Array} The clear cell value ranges whose item type is GC.Spread.Sheets.Range.
isUndo {boolean} true if this is an undo operation; otherwise, false.
Syntax
var value; // Type: clearValues
value = GC.Spread.Sheets.Commands.clearValues;
var clearValues : clearValues;
Example
The following examples clear cells.
//Add data
for (var col = 1; col < 6; col++) {
    for (var row = 2; row < 11; row++) {
        activeSheet.setValue(row, col, row + col);
    }
}

$("#button1").click(function () {
spread.options.allowUndo = true;
spread.commandManager().execute({cmd: "clearValues", sheetName: "Sheet1", ranges: [new GC.Spread.Sheets.Range(8, 5, 2, 1)]});
    });

<input type="button" id="button1" value="button1"/>
//Add data
for (var col = 1; col < 6; col++) {
    for (var row = 2; row < 11; row++) {
        activeSheet.setValue(row, col, row + col);
    }
}

$("#button1").click(function () {
spread.options.allowUndo = true;
//Select a block of cells first
spread.commandManager().execute({cmd: "clearValues", sheetName: "Sheet1", ranges: activeSheet.getSelections()});
    });

<input type="button" id="button1" value="button1"/>
See Also

Reference

Commands type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.