Posted 30 September 2019, 4:09 pm EST
Hi Davide,
The blog post refers to an older version of SpreadJs. In the current version(v12), we need to register our custom commands using the commandManager.register() method. Please refer to the following code snippet and the sample demonstrating the same:
function registerCustomCommands(spread) {
var commandManager = spread.commandManager();
var editOnF2Command = {
canUndo: false,
execute: function(wbContext, options, isUndo) {
var sheet = wbContext.getSheetFromName(options.sheetName);
if (sheet) {
sheet.startEdit();
}
return true;
}
};
commandManager.register(
"editOnF2Command",
editOnF2Command,
113, // key code for F2
false,
false,
false,
false
);
}
https://codesandbox.io/s/spread-js-starter-jgutp
API reference:
• register method: http://help.grapecity.com/spread/SpreadSheets12/webframe.html#SpreadJS~GC.Spread.Commands.CommandManager~register.html
For any query or issues related to Spread.Sheets, please use the following support forum dedicated to Spread.Sheets discussions:
https://www.grapecity.com/forums/spread-sheets
Regards
Sharad