Hi All,
I have a group called Task that can store nodes. I would like to be able to link Tasks without using ports. Before I got the grouping part of Tasks working the linking functionality worked.
I’m guessing the linking still works, the issue is there is no point in the diagram element ‘Task’ to indicate (with the ‘glove cursor/pointer’?) to say that a user wants to start a link from the element or end a link on the element. The entire Task group graphical parts have been assigned to moving the group around the diagram or used for grouping node. I’m guessing the best solution is to use the textblock area in the element as the only place to allow movement of the element and the rest of the element for the link in/out. Or vice versa.
Had hoped there might be moveObjectName or linkObjectName.
Also tried adding fromLinkable: <span =“s1” style=“line-height: 1.4;”>true, toLinkable: <span =“s1” style=“line-height: 1.4;”>true to the Shape/TextBlock/Placeholder but no luck.
<span =“s1” style=“line-height: 1.4;”>
<span =“s1” style=“line-height: 1.4;”>Any advice appreciated,
<span =“s1” style=“line-height: 1.4;”>
Z
myDiagram.groupTemplateMap.add("Task",
$(go.Group, go.Panel.Auto,
{
movable: true, copyable: false, deletable: true, // can move, can be deleted, avoidable???
avoidable: false, //fromLinkable: true, toLinkable: true,
selectionObjectName: "SHAPE", // selecting a lane causes the body of the lane to be highlit, not the label
//moveObjectName: "TEXT",
//linkObjectName: "TEXT",
//resizable: true, resizeObjectName: "SHAPE", // the custom resizeAdornmentTemplate only permits two kinds of resizing
layout: $(go.LayeredDigraphLayout, // automatically lay out the lane's subgraph
{ direction: HORIZONTAL ? 50 : 50, columnSpacing: 1, layeringOption: go.LayeredDigraphLayout.LayerLongestPathSource }),
computesBoundsAfterDrag: true, // needed to prevent recomputing Group.placeholder bounds too soon
computesBoundsIncludingLinks: false,
computesBoundsIncludingLocation: true,
mouseDrop: function (e, grp) { // dropping a copy of some Nodes and Links onto this Group adds them to this Group
if (!e.shift && !e.control) return; // cannot change groups with an unmodified drag-and-drop
var ok = grp.addMembers(grp.diagram.selection, true);
if (!ok) grp.diagram.currentTool.doCancel();
},
computesBoundsAfterDrag: true
},
$(go.Panel, "Auto", // the lane consisting of a background Shape and a Placeholder representing the subgraph
$(go.Shape, "RoundedRectangle",
{minSize: new go.Size(100, 100), name: "SHAPE", fill: "white", maxSize: new go.Size(100, 200), fromLinkable: true, toLinkable: true},
new go.Binding("fill", "color")),
$(go.TextBlock, { name: "TEXT", margin: 1, alignment: go.Spot.Top, fromLinkable: true, toLinkable: true }, //margin - how far from the top
new go.Binding("text", "key")),
$(go.Placeholder,
{ padding: 15, alignment: go.Spot.TopLeft, fromLinkable: true, toLinkable: true })
) // end Auto Panel
// limit dragging of Nodes to stay within the containing Group, defined above - redo with out error
));