客户的行为中断了编辑状态的周期,请尝试使用setTimeout避免这些问题。
参考以下的实现方式:
- spread.bind(GC.Spread.Sheets.Events.EditEnded, (e, args) => {
- const sheet = args.sheet
- const sheetName = args.sheetName
- const row = args.row
- const col = args.col
- const text = args.editingText
- console.log(11, args)
- setTimeout(function () {
- const dataTableSheet = spread.getSheetFromName('Sheet2')
- dataTableSheet.addRows(1, 1);
- spread.commandManager().execute( { cmd: 'clipboardPaste', fromSheet: dataTableSheet, fromRanges: [range1], sheetName: 'Sheet2', pastedRanges: [range2], isCutting: false, clipboardText: '', pasteOption: GC.Spread.Sheets.ClipboardPasteOptions.all }
- )
- }, 0);
- })
复制代码 |