我如何禁用GoJS中的默认菜单

时间:2018-07-12 05:13:44

标签: menu gojs

我是gojs的新手, 当我按下页面中的手机屏幕(#myDiagram div)时,会出现一些默认菜单,但我不想要它。

我尝试通过设置"toolManager.isEnable":false来禁用它,但是没有用

 myDiagram =
        $(go.Diagram, "myDiagramDiv",
          {
            initialAutoScale: go.Diagram.Uniform,
            initialContentAlignment: go.Spot.Center,
            allowDrop: false,
            allowMove: false,
            "toolManager.isEnable":false,
            nodeSelectionAdornmentTemplate:
              $(go.Adornment, "Auto",
                { layerName: "Grid" }, 
                $(go.Placeholder)
              ),
            layout:  // use a custom layout, defined below
              $(GenogramLayout, { direction: 90, layerSpacing: 30, columnSpacing: 10 })
          });

我如何禁用它?

按下后显示的内容是
here is what shows after press

1 个答案:

答案 0 :(得分:0)

https://gojs.net/latest/intro/contextmenus.html#DefaultContextMenuForTouchEnabledDevices中所述,您只需将 ContextMenuTool 属性设置为null。例如,在初始化时:

SELECT *
FROM PRODUCT p
WHERE NOT EXISTS (SELECT 1 FROM SUPPLIER S WHERE S.SUPPL_CODE = p.SUPPL_CODE );