SpreadJS Documentation
doCommand Method
The action to perform.
Performs an action and adds it to the undo list if the action can be undone.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var value; // Type: any
value = instance.doCommand(action);
function doCommand( 
   action : ActionBase
) : any;

Parameters

action
The action to perform.
Example
This example uses the drag drop action.
//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.allowUndo(true);
var dd = new GcSpread.Sheets.UndoRedo.DragDropExtent(2, 1, 12, 2, 2, 2);
var action = new GcSpread.Sheets.UndoRedo.DragDropUndoAction(activeSheet, dd, true, false, GcSpread.Sheets.ClipboardPasteOptions.Values);
activeSheet.doCommand(action);
    });

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

Reference

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.