Posted 12 April 2020, 11:29 pm EST
I want to bind enterCell、editChange…undo event, whether I have to register custom event with commandManager?
Like
const customEnterCell = {
canUndo: true,
execute: (
workbook: GC.Spread.Sheets.Workbook,
options: any,
isUndo: boolean
) => {
const Commands = GC.Spread.Sheets.Commands
const { row, col, sheet, sheetName } = options
console.log(row, col, isUndo)
if (isUndo) {
Commands.undoTransaction(workbook, options)
// to do undo handle
return true
} else {
Commands.startTransaction(workbook, options)
this.workbook.focus(true)
sheet.setActiveCell(row, col)
this.emit(‘enterCell’, {
sheet,
sheetName,
row,
col
})
Commands.endTransaction(workbook, options)
return true
}
}
Whether I shouldn’t use spread default events like entercell
,userFormulaEntered …
I need to get undo handle for every operation
