您好,请参考以下代码:
- let oldOpenMenu = spread.contextMenu.onOpenMenu;
- spread.contextMenu.onOpenMenu = function (
- menuData,
- itemsDataForShown,
- hitInfo,
- spread
- ) {
- oldOpenMenu.apply(this, arguments);
- itemsDataForShown.forEach((element) => {
- if (element.name === "tableInsert") {
- element.subMenu.forEach((element) => {
- element.disable = false;
- });
- }
- });
- };
复制代码 |