了解了,请参考以下代码:
- let designerConfig = JSON.parse(
- JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig)
- );
- designerConfig.commandMap = {
- autoBind: {
- title: "一键绑定",
- text: "一键绑定",
- iconClass: "ribbon-thumbnail-table",
- bigButton: "true",
- commandName: "autoBind",
- execute: function (context, propertyName, fontItalicChecked) {
- console.log(123);
- },
- },
- dropDown: {
- title: "一键绑定",
- text: "一键绑定",
- iconClass: "ribbon-thumbnail-table",
- bigButton: "true",
- commandName: "dropDown",
- },
- };
- let dropDownMenu = {
- label: "页面设置",
- thumbnailClass: "ribbon-thumbnail-table",
- commandGroup: {
- children: [
- {
- children: [
- {
- command: "dropDown",
- type: "dropdown",
- children: ["autoBind", "autoBind"],
- },
- ],
- },
- ],
- },
- };
- designerConfig.ribbon[4].buttonGroups.push(dropDownMenu);
- let designer = new GC.Spread.Sheets.Designer.Designer(
- "gc-designer-container",
- designerConfig
- );
复制代码
|