myDiagram.nodeTemplateMap.add(rootNodeLabel, Go(go.Node, "Auto", {
_viewPosition: new go.Point(0,0),
//layerName: "Grid",
deletable: false
}, new go.Binding("textEditable", "readOnly"),
// new go.Binding("allowDelete",
// "foreignKey",function(v){if(v==true){return false;}else
// {return
// true;}}),
Go(go.Shape, "RoundedRectangle", {
parameter1: 20, // the corner has a large radius
fill: Go(go.Brush, "Linear", {
0: "rgb(254, 201, 0)",
1: "rgb(254, 162, 0)"
}),
stroke: "black",
portId: "",
fromLinkable: false,
fromLinkableSelfNode: false,
fromLinkableDuplicates: false,
toLinkable: false,
toLinkableSelfNode: false,
toLinkableDuplicates: false,
cursor: "pointer"
}), Go(go.TextBlock, {
font: "bold 11pt helvetica, bold arial, sans-serif",
editable: false
// editing the text automatically updates
// the model data
}, new go.Binding("text", "text").makeTwoWay()), {
selectionAdornmentTemplate: Go(go.Adornment, "Spot", Go(go.Panel,
"Auto",
// this Adornment has a rectangular blue Shape around the
// selected
// node
Go(go.Shape, "Rectangle", {
fill: null,
stroke: "black",
strokeWidth: 1
}), Go(go.Placeholder))
// and this Adornment has a Button to the right of the
// selected node
)
// end Adornment
}
));
this is what i m using as template and the listener is the same as the static part topic