您好, 请参考以下代码:- var designerConfig = JSON.parse(JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig));
- // 修改原有命令结构
- var command = JSON.parse(JSON.stringify(GC.Spread.Sheets.Designer.getCommand("cellsFormat")));
- for(var i = command.subCommands.length - 1; i >= 0; i--) {
- if(command.subCommands[i] == "cellFormatProtectSheet" || command.subCommands[i] == "unProtectSheet" || command.subCommands[i] == "lockCells" || command.subCommands[i] == "unLockCells") {
- command.subCommands.splice(i, 1);
- }
- }
- // 替换命令
- designerConfig.commandMap = {}
- designerConfig.commandMap["cellsFormat"] = command;
- // 初始化designer
- var d = new GC.Spread.Sheets.Designer.Designer("gc-designer-container", designerConfig, undefined);
复制代码 实现效果如下:
|