您好,在Excel中,选中一片区域,然后输入数值1,按下快捷键ctrl+enter ,
此时此片区域的值都是1 ,如下动图所示
在SpreadJS中,设置了如下代码
- var sheet = spread.getActiveSheet();
- let command = {
- canUndo: true,
- execute: function (context, options, isUndo) {
- let Commands = GC.Spread.Sheets.Commands;
- options.cmd = "copyALl";
- if (isUndo) {
- Commands.undoTransaction(context, options);
- return true;
- } else {
- Commands.startTransaction(context, options);
- console.log(sheet.isEditing())
- if (sheet.isEditing()) {
- sheet.endEdit()
- let value = sheet.getCell(sheet.getActiveRowIndex(), sheet.getActiveColumnIndex()).value()
- let rangeList = sheet.getSelections()
- for (let i = 0; i < rangeList.length; i++) {
- let range = rangeList[i]
- let {row, col, rowCount, colCount} = range;
- if (sheet.getRowVisible(row) && sheet.getColumnVisible(col)) {
- sheet.getRange(row, col, rowCount, colCount).value(value)
- }
- }
- }
- }
- },
- };
- let commandManager = spread.commandManager();
- commandManager.register("copyALl", command);
- spread.commandManager().setShortcutKey("copyALl", GC.Spread.Commands.Key.enter, true, false, false, false);
复制代码
打开附件中的html,
在公式编辑器中输入数值1,然后按下快捷键ctrl+enter ,其效果与Excel一致
在单元格中直接输入数值1,此时按下快捷键ctrl+enter,会发现单元格换行
所以复现了您的问题,我们将深入调研下此问题,问题编号:SJS-22239
|
|