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 })
});
我该如何禁用它?
解决方案
如https://gojs.net/latest/intro/contextmenus.html#DefaultContextMenuForTouchEnabledDevices中所述,您只需将ContextMenuTool属性设置为 null。例如,在Diagram的初始化过程中:
$(go.Diagram, . . .,
{
"contextMenuTool.defaultTouchContextMenu": null
})
推荐阅读
- javascript - it 块在 beforeEach 块 Jasmin 之前被调用
- c# - C# xml 到对象(反序列化)
- python - 如何从 Python 创建多个 JSON 文件
- reactjs - React 无法在单行中呈现数组(状态)
- ruby - 单例类的外观
- c# - 如何从 dotnet 正确启动 Windows 10 上的照片应用程序
- java - TextView.setText() 上的 Java 空指针异常
- angular - Angular2 - 如何将文本框放入 *ngFor
- c# - 如何找出用于已安装 NuGet 包的库?
- python - 通过python在centos7服务器上连接mysql问题