formtted and taken out events…
myDiagram.nodeTemplate = $(go.Node, "Auto", {
height : 70
},
// for sorting, have the Node.text be the data.name
new go.Binding("text", "name"),
new go.Binding("layerName", "isSelected", function(sel) {
return sel ? "Foreground" : "";
}).ofObject(),
// define the node's outer
$(go.Shape, "Rectangle", {
name: "SHAPE",
fill: "white",
stroke: null,
// set the port properties:
portId: "",
fromLinkable: true,
toLinkable: true,
cursor: "pointer"
}), $(go.Panel, "Table", { defaultAlignment: go.Spot.Bottom },
$(go.Panel, "Auto",
{ row: 0, column: 0, margin: 2, columnSpan: 3,rowSpan: 3, stretch: go.GraphObject.Horizontal, alignment: go.Spot.Bottom },
$(go.Shape, "RoundedRectangle"),
$(go.Picture, {
name: "Picture",
}, new go.Binding("source", "key", findHeadShot))),
$(go.Panel, "Auto",
{row: 0, column: 6,margin: 2,alignment: go.Spot.Bottom,
desiredSize: new go.Size(15, 15) },
$(go.Picture, {
name: "Picture",
}, new go.Binding("source", "isCommandAlter", findUpArrowImg), new go.Binding("visible", "isCommandRepAccess"))),
$(go.Panel, "Auto",
{row: 0, column: 7,margin: 2,alignment: go.Spot.Bottom,
desiredSize: new go.Size(15, 15) },
$(go.Picture, {
name: "Picture",
}, new go.Binding("source", "isCommandRepAccess", findIRSImg), new go.Binding("visible", "isCommandRepAccess"))),
$("Button", {
row: 4, column: 7,margin: 2,
alignment: go.Spot.BottomRight,
alignmentFocus: go.Spot.BottomRight,
name: 'TREEBUTTON',
click: function(e, obj) { // OBJ is the Button
myDiagram.commandHandler.showContextMenu(e.targetObject);
e.handled = true;
}
//mouseClick: function(e, obj) { myDiagram.commandHandler.showContextMenu(e.targetObject);}
},
$(go.Picture, {
name: "Picture",margin: 2,
desiredSize: new go.Size(15, 15),
}, new go.Binding("source", "key", findPencilImg)),
new go.Binding("visible", "key", showContextButton)),
// define the panel where the text will appear
$(go.TextBlock, textStyle(), // the name
{
row: 1,
column: 3,
columnSpan: 2,
margin: 2,
width: 150,
font: "8pt Segoe UI,sans-serif",
editable: false,
isMultiline: true,
//stroke :"#a3fff1",
minSize: new go.Size(10, 16)
}, new go.Binding("text", "orgName").makeTwoWay(), new go.Binding("stroke", "highlight", function(v) {
return v ? "black" : "white";
})),
$(go.TextBlock, textStyle(), // the name
{
row: 2,
column: 3,
columnSpan: 2,
margin: 2,
width: 150,
font: "8pt Segoe UI,sans-serif",
//stroke :"#a3fff1",
editable: false,
isMultiline: true,
minSize: new go.Size(10, 16)
}, new go.Binding("text", "personName").makeTwoWay(), new go.Binding("stroke", "highlight", function(v) {
return v ? "black" : "white";
}))
) // end Horizontal Panel
); // end Node