1金币
本帖最后由 Ellia.Duan 于 2022-11-14 09:41 编辑
我使用了 sheet.fillAuto()这个方法操作后按 ctrl+z 快捷键不能实现撤销功能。请问跟我使用注册快捷键实现自动填充有关系吗?怎么解决呢?- spread.commandManager().register('fillDown', () => {
- spread.suspendEvent();
- const sheet = spread.getActiveSheet();
- const { row, col, rowCount, colCount } = sheet.getSelections()[0];
- let startRange: GC.Spread.Sheets.Range, wholeRange: GC.Spread.Sheets.Range;
- for (let i = 0; i < colCount; i++) {
- startRange = new GC.Spread.Sheets.Range(row, col + i, 1, 1);
- wholeRange = new GC.Spread.Sheets.Range(row, col + i, rowCount, 1);
- sheet.fillAuto(startRange, wholeRange, {
- fillType: 0,
- series: 0,
- direction: 3,
- });
- }
- spread.resumeEvent();
- });
- spread.commandManager().setShortcutKey('fillDown', 68, false, true, true, false);
复制代码
|
|