背景: 用户想实现通过API的方式将某sheet页 内容复制到另一个sheet页的对应位置 实现效果:
此Demo中点击button1 实现sheet1的内容剪切到sheet2,点击button2 实现sheet1的内容复制到sheet2。
关键代码:
- spread.commandManager().execute({
- cmd: "clipboardPaste",
- sheetName: "Sheet2",
- fromSheet: activeSheet,
- fromRanges: fromRange,
- pastedRanges: toRanges,
- isCutting: true,
- clipboardText: "",
- pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all
- });
复制代码- spread.commandManager().execute({
- cmd: "clipboardPaste",
- sheetName: "Sheet2",
- fromSheet: activeSheet,
- fromRanges: fromRange,
- pastedRanges: toRanges,
- isCutting: false,
- clipboardText: "",
- pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all
- });
复制代码
|
|