Spread.Sheets Documentation
dragDrop Field
Represents the command used to drag a range and drop it onto another range on the worksheet.
* The command has a boolean field canUndo that indicates whether the command supports undo and redo operation, and a method execute that performs an execute operation or undo operation.
* The arguments of the execute method are as follows.
context {GC.Spread.Sheets.Workbook} The context of the operation.
commandOptions {Object} The options of the operation.
* commandOptions.sheetName {string} The sheet name.
* commandOptions.fromRow {number} The source row index for the drag drop.
* commandOptions.fromColumn {number} The source column index for the drag drop.
* commandOptions.toRow {number} The destination row index for the drag drop.
* commandOptions.toColumn {number} The destination column index for the drag drop.
* commandOptions.rowCount {number} The row count for the drag drop.
* commandOptions.columnCount {number} The column count for the drag drop.
* commandOptions.copy {boolean} If set to true copy; otherwise, cut if false.
* commandOptions.insert {boolean} If set to true inserts the drag data in the drop row or column.
* commandOptions.option {GC.Spread.Sheets.CopyToOptions} Indicates the content type to drag and drop.
isUndo {boolean} true if this is an undo operation; otherwise, false.
Syntax
var value; // Type: dragDrop
value = GC.Spread.Sheets.Commands.dragDrop;
var dragDrop : dragDrop;
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.options.allowUndo = true;
spread.commandManager().execute({cmd: "dragDrop",  sheetName: "Sheet1", fromRow:2, fromColumn:1, toRow:12, toColumn:2, rowCount:2, columnCount:2, copy: true, insert: false, option: GC.Spread.Sheets.CopyToOptions.values});
    });


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

Reference

Commands type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.