Hi !
Yes I read the documentation.
I tried to insert the default context menu into my diagram but when it load, it throw an error :
///
Uncaught Error: GraphObject.contextMenu must be an Adornment or HTMLInfo.
at v (go-debug.js:12)
at V.set (go-debug.js:985)
at Lj (go-debug.js:663)
at Rl (go-debug.js:951)
at Pl (go-debug.js:946)
at init ((index):666)
at Object.success ((index):1212)
at j (jquery-js:2)
at Object.fireWith [as resolveWith] (jquery-js:2)
at x (jquery-js:4)
///
I’ve follow the instruction of the tutorial.
You can see below the genogram of the tutorial.
I added the default Context menu into the template like this :
///
myDiagram.nodeTemplateMap.add(“F”,
$$(go.Node, “Vertical”,
{ locationSpot: go.Spot.Center, locationObjectName: “ICON”},
$$(go.Panel,
{ name: "ICON" },
$$(go.Shape, "Circle",
{ width: 40, height: 40, strokeWidth: 2, fill: "white", portId: "" }),
$$(go.Panel,
{
itemTemplate:
$$(go.Panel,
$$(go.Shape,
{ stroke: null, strokeWidth: 0 },
new go.Binding("fill", "", attrFill),
new go.Binding("geometry", "", femaleGeometry))
),
margin: 1
},
new go.Binding("itemArray", "a")
)
),
$$(go.TextBlock,
{ textAlign: "center", maxSize: new go.Size(80, NaN) },
new go.Binding("text", "n")),
{ //Adding the context menu to the template .
contextMenu:
$("ContextMenu",
$("ContextMenuButton",
$(go.TextBlock, "Test ContextMenu"),
{ click: testContextMenuClick })
)
}
));
///
If I understood, this kind of contextMenu doesn’t need to be declare through a HTML block .
So I don’t know why the loading throw an execption …
Thank you for your time and your help !