非常感谢
现在是在选中特定的列以后,会把删除按钮禁用掉,但是希望在选中其它列时能够重新启用删除按钮。
sheet.bind(GC.Spread.Sheets.Events.SelectionChanging, (e: any, args: any) => {
const { col, colCount } = args.newSelections[0]
const command = {
canUndo: false,
execute: function (context:GC.Spread.Sheets.Workbook, options:any, isUndo:any) {
const Commands = GC.Spread.Sheets.Commands
if (isUndo) {
Commands.undoTransaction(context, options)
return true
} else {
Commands.startTransaction(context, options)
Commands.endTransaction(context, options)
return true
}
}
}
if (col + colCount > 38 && col <= 38) {
spread?.commandManager().register('ban', command)
spread?.commandManager().setShortcutKey('ban', GC.Spread.Commands.Key.backspace, false, false, false, false)
spread?.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false)
}
}) |