Hi
whenever i am trying to edtit textblock its size get auto increased and going out node size thats not look good.
node Template :
var SSDnodeTemplate =
$(go.Node,
“Auto”,
{
fromSpot: go.Spot.BottomSide,
toSpot: go.Spot.TopSide,
minSize: new go.Size(120, 50),
},
$(go.Shape, “RoundedRectangle”, {
stretch: go.GraphObject.Fill,
fromSpot: go.Spot.BottomSide,
toSpot: go.Spot.TopSide,
alignment: go.Spot.Center,
fromLinkableDuplicates: true, toLinkableDuplicates: true,
fromLinkable: true,
toLinkable: true,
fromLinkableSelfNode: true,
toLinkableSelfNode: true,
fill: $(go.Brush, “Linear”, { 0.0: “rgb(250, 267, 255)”, 0.9: “rgb(250, 267, 255)” })
},
new go.Binding(“fill”, “category”, CallBrushConverter),
{
contextMenu: // define a context menu for each node
$(“ContextMenu”, // that has one button
$(“ContextMenuButton”,
{
“ButtonBorder.fill”: “white”,
“_buttonFillOver”: “skyblue”
},
$(go.TextBlock, "GO to URL"),
{ click: showMessage },
new go.Binding("visible", "isButtonvisible")
)
// more ContextMenuButtons would go here
) // end Adornment
}
),
$(go.TextBlock,
{
//maxSize: new go.Size(120, NaN),
minSize: new go.Size(110,NaN),
//width:110,
height: 24,
text: "textAlign: 'center'",
textAlign: "center",
isMultiline: false,
editable: true,
stretch: go.GraphObject.Horizontal,
font: "Bold 12pt Sans-Serif",
},
new go.Binding("text", "text").makeTwoWay(),
{
toolTip:
$("ToolTip",
$(go.TextBlock, { margin: 4 },
new go.Binding("text", "text"))
), // end of Adornment
contextMenu: // define a context menu for each node
$("ContextMenu", // that has one button
$("ContextMenuButton",
{
"ButtonBorder.fill": "white",
"_buttonFillOver": "skyblue"
},
$(go.TextBlock, "GO to URL"),
{ click: showMessage },
new go.Binding("visible", "isButtonvisible")
)
)
}
),
{
selectionAdornmentTemplate:
$(go.Adornment, "Auto",
$(go.Shape, "RoundedRectangle",
{
fill: null,
stroke: "#0047AB",
strokeWidth: 6
}),
$(go.Placeholder)
) // end Adornment
}
);
Diagram :