您可以参考以下代码:
var CustomerConfig = GC.Spread.Sheets.Designer.DefaultConfig;
if (CustomerConfig.contextMenu) {
for (let i = 0; i < CustomerConfig.contextMenu.length; i++) {
if (CustomerConfig.contextMenu === GC.Spread.Sheets.Designer.CommandNames.DeleteDialog) {
CustomerConfig.contextMenu.splice(i, 1)
}
}
}
var designer = new GC.Spread.Sheets.Designer.Designer(
document.getElementById('gc-designer-container'),
CustomerConfig
);
结果如下图:
删除右键菜单 “插入”项同理,只需修改 CommandNames.DeleteDialog 修改为对应的名称即可。
|