ribbon的样式设置实际上都是在config的commandMap中进行定义的,以添加一个welcome按钮为例:
- var config = GC.Spread.Sheets.Designer.DefaultConfig;
- config.commandMap = {
- Welcome: {
- title: "Welcome",
- text: "Welcome",
- iconClass: "ribbon-button-welcome",
- bigButton: "true",
- commandName: "Welcome",
- execute: function (context, propertyName, fontItalicChecked) {
- alert('Welcome to new designer.');
- }
- }
- }
- config.ribbon[0].buttonGroups.unshift({
- "label": "NewDesigner",
- "thumbnailClass": "welcome",
- "commandGroup": {
- "children": [
- {
- "direction": "vertical",
- "commands": [
- "Welcome"
- ]
- }
- ]
- }
- });
- var designer = new GC.Spread.Sheets.Designer.Designer(document.getElementById("gc-designer-container"), config);
复制代码
更多ribbon添加修改可以参考这里的技术博客:https://gcdn.grapecity.com.cn/forum.php?mod=viewthread&tid=87119&extra=page%3D6
|