Hi all,
I am having trouble getting the text to land where I think I put it. I know I am doing something stupid.
I am using the dynamic ports example to start with. I need to associate port labels with the port geometry. I have the labels added and almost rendering where I want them.
Here is the code for the very left vertical panel:
$$(go.Panel, "Vertical",
new go.Binding("itemArray", "leftArray"),
{ row: 1, column: 0, columnSpan: 1,
itemTemplate:
$$(go.Panel, "Spot",
{ _side: "left", // internal property to make it easier to tell which side it's on
fromSpot: go.Spot.Left, toSpot: go.Spot.Left,
fromLinkable: true, toLinkable: true, cursor: "pointer",
contextMenu: portMenu
},
new go.Binding("portId", "portId"),
//this is hidden by the textblock but that is unimportant for now.
//I just want to make sure I have the structure right first.
$$(go.Shape, "Rectangle",
{
stroke: null, strokeWidth: 0,
desiredSize: hPortSize,
margin: new go.Margin(0,0) },
new go.Binding("fill", "portColor")),
$$(go.TextBlock,
{ background: "lightgreen", alignment: new go.Spot(1, 0.5)/*I have tried this and go.Spot.Right to no avail*/, font: "14px Segoe UI,sans-serif", stroke: "black", editable:"true", isMultiline:"false"},
new go.Binding("text", "portConn").makeTwoWay())
) // end itemTemplate
}
), // end Vertical Panel
Any help would be greatly appreciated.
Thanks!