let designerInitialized = (wb) => {
designer = wb;
let spread = designer.getWorkbook();
console.log(spread, "spread");
console.log(designer, "designer");
var designerConfig = JSON.parse(
JSON.stringify(GC.Spread.Sheets.Designer.DefaultConfig)
);
designerConfig.commandMap = {
myCmd: {
text: "弹窗菜单",
commandName: "myCmd",
visibleContext: "ClickRowHeader",
execute: () => {
alert("我是重写的右键菜单");
},
},
};
designerConfig.contextMenu.push("myCmd");
designer._config = designerConfig;
console.log(designer, "designer1");
var sheet = spread.getActiveSheet();
sheet.setArray(0, 0, [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
[10, 11, 12],
[13, 14, 15],
]);
};
直接操作设计器对象,菜单也没有出来,麻烦看一下什么问题
|