Posted 9 December 2024, 6:19 am EST
In TableSheet, I’ve customized the default openDateTimePicker to execute with my function to disable the DateTimePicker in some cells. When my TableSheet data changes (cell no longer disabled), I want to apply another customization to this command. However, TableSheet handles both the old and new commands. Is there a way to remove the old customization and replace it with a new one? Here is my example:
let oldOpenDateTimeCmd =
GC.Spread.Sheets.Commands.openDateTimePicker.execute
GC.Spread.Sheets.Commands.openDateTimePicker.execute = function () {
let options = arguments[1]
if (disabledRows.includes(options.row)) return false
return oldOpenDateTimeCmd.apply(this, arguments as any)
}