SpreadJS Documentation
ClipboardPasteUndoAction Constructor
The sheet that is invoking the action.
The source sheet for the copy or cut.
The target sheet for pasting.
The paste extent information.
The Clipboard pasting option that indicates which content to paste.
Represents the Clipboard paste undo action for pasting on the sheet.
Syntax
var instance = new GcSpread.Sheets.UndoRedo.ClipboardPasteUndoAction(sheet, srcSheet, destSheet, pasteExtent, option);
function ClipboardPasteUndoAction( 
   sheet : Sheet,
   srcSheet : Sheet,
   destSheet : Sheet,
   pasteExtent : object,
   option : ClipboardPasteOptions
) : ClipboardPasteUndoAction;

Parameters

sheet
The sheet that is invoking the action.
srcSheet
The source sheet for the copy or cut.
destSheet
The target sheet for pasting.
pasteExtent
The paste extent information.
option
The Clipboard pasting option that indicates which content to paste.
Example
This example cuts data.
activeSheet.setValue(0, 0, 1, GcSpread.Sheets.SheetArea.viewport);
activeSheet.setValue(1, 0, 2, GcSpread.Sheets.SheetArea.viewport);
activeSheet.setFormula(2, 0, "=A1+A2", GcSpread.Sheets.SheetArea.viewport);
activeSheet.setValue(0, 1, 3, GcSpread.Sheets.SheetArea.viewport);
activeSheet.setValue(1, 1, 4, GcSpread.Sheets.SheetArea.viewport);
activeSheet.setFormula(2, 1, "=B1+B2", GcSpread.Sheets.SheetArea.viewport);
    var fromRange = new GcSpread.Sheets.Range(0, 0, 3, 2);
    var toRanges = [new GcSpread.Sheets.Range(4, 0, 3, 2)];

$("#button1").click(function () {
        //Cut Paste Action
        var clipboardCutPasteAction = new GcSpread.Sheets.UndoRedo.ClipboardPasteUndoAction(activeSheet, activeSheet, activeSheet, { fromRange: fromRange, pastedRanges: toRanges, isCutting: true, clipboardText: "" }, GcSpread.Sheets.ClipboardPasteOptions.Values);
        clipboardCutPasteAction.execute(activeSheet);
    });
  
    $("#button2").click(function () {
        //Copy Paste Action
        var clipboardCopyPasteAction = new GcSpread.Sheets.UndoRedo.ClipboardPasteUndoAction(activeSheet, activeSheet, activeSheet, { fromRange: fromRange, pastedRanges: toRanges, isCutting: false, clipboardText: "" }, GcSpread.Sheets.ClipboardPasteOptions.Values);
        clipboardCopyPasteAction.execute(activeSheet);
    });

//Add button controls to page
<input type="button" id="button1" value="button1"/>
<input type="button" id="button2" value="button2"/>
See Also

Reference

ClipboardPasteUndoAction type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.