Skip to content

Commit

Permalink
feat: add startEditCell api #1573
Browse files Browse the repository at this point in the history
  • Loading branch information
fangsmile committed Apr 23, 2024
1 parent 023d678 commit 1ecbcda
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/vtable/src/PivotTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,18 @@ export class PivotTable extends BaseTable implements PivotTableAPI {
}
this.eventManager.updateEventBinder();
}
/** 开启单元格编辑 */
startEditCell(col?: number, row?: number) {
if (isValid(col) && isValid(row)) {
this.selectCell(col, row);
this.editorManager.startEditCell(col, row);
} else if (this.stateManager.select?.cellPos) {
const { col, row } = this.stateManager.select.cellPos;
if (isValid(col) && isValid(row)) {
this.editorManager.startEditCell(col, row);
}
}
}
/** 结束编辑 */
completeEditCell() {
this.editorManager.completeEdit();
Expand Down

0 comments on commit 1ecbcda

Please sign in to comment.