// たとえば、次のサンプルコードはchangeBackColorコマンドを登録してから、そのコマンドを実行します。 var command = { canUndo: true, execute: function (context, options, isUndo) { var sheet = context.getSheetFromName(options.sheetName); var cell = sheet.getCell(options.row, options.col); if (isUndo) { cell.backColor(options._oldBackColor); } else { options._oldBackColor = cell.backColor(); cell.backColor(options.backColor); } } }; var spread = GC.Spread.Sheets.findControl(document.getElementById("ss")); var commandManager = spread.commandManager(); commandManager.register("changeBackColor", command); commandManager.execute({cmd: "changeBackColor", sheetName: spread.getSheet(0).name(), row: 1, col: 2, backColor: "red"});