参考附件demo,主要代码如下:
- window.onload = function () {
- var toolbarConfig = JSON.parse(JSON.stringify(GC.Spread.Sheets.Designer.ToolBarModeConfig));
- toolbarConfig.ribbon.panels[0].buttonGroups[0].commandGroup.children.splice(1,0,"redo");
- toolbarConfig.ribbon.panels[0].buttonGroups[0].commandGroup.children.splice(1,0,"formatPainter");
- var redoCmd = GC.Spread.Sheets.Designer.getCommand(GC.Spread.Sheets.Designer.CommandNames.Redo);
- redoCmd.visiblePriority = 9;//make it the same with undo command.
- toolbarConfig.commandMap = {
- "redo": redoCmd
- }
- console.log(toolbarConfig.ribbon.panels[0].buttonGroups[0].commandGroup.children);
- var designer = new GC.Spread.Sheets.Designer.Designer("gc-designer-container", toolbarConfig);
- var spread = designer.getWorkbook();
- var sheet = spread.getActiveSheet();
- sheet.setValue(0, 0, 1);
- }
复制代码
|
|