Posted 19 March 2020, 11:25 am EST
I’ve made some custom context menus. When I execute a command from context menus, undo works well. But, when I execute it by shortcut key, undo does not work.
Here is my code snippet.
var insertDateCommand = { canUndo: true, execute: function (context, options, isUndo) { var commands = GC.Spread.Sheets.Commands; if (isUndo) { commands.undoTransaction(context, options); return true; } else { commands.startTransaction(context, options); setDateToSelectedCells(context); commands.endTransaction(context, options); return true; } } }; // alt + 1 commandManager.register("insertDate", insertDateCommand, 49, false, false, true, false);
Thank you in advance.