我写了一个简单的Sample,你可以参考一下:
let designerConfig = JSON.parse(
JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig)
);
let c1 = {
title: "test1",
text: "test1",
type: "checkbox",
commandName: "test1",
};
let c2 = {
title: "test2",
text: "test2",
type: "checkbox",
commandName: "test2",
};
let c3 = {
title: "test3",
text: "test3",
type: "checkbox",
commandName: "test3",
};
designerConfig.commandMap = {
c1,
c2,
c3,
};
designerConfig.ribbon[0].buttonGroups.push({
label: "test",
commandGroup: {
children: [
{
direction: "vertical",
children: [
{
direction: "horizontal",
commands: ["c1", "c2"],
},
{
direction: "horizontal",
commands: ["c1", "c2", "c3"],
},
],
},
],
},
});
let designer = new GC.Spread.Sheets.Designer.Designer(
"gc-designer-container",
designerConfig
); |