Hello everyone! For you guys it’s probably a simple thing: I want to have an editable TextBlock inside a table column to stretch the whole width of the column.
$(go.Panel, "Table",
{
row: 4,
name: "Attributes",
alignment: go.Spot.TopLeft,
defaultAlignment: go.Spot.Left,
defaultRowSeparatorStroke: "#f0f0f0",
stretch: go.GraphObject.Horizontal,
margin: 5,
itemTemplate: $(go.Panel, "TableRow",
$(go.TextBlock,
{
column: 0,
stroke: "#7a7a7a",
height: 24,
width: 24,
verticalAlignment: go.Spot.LeftCenter,
spacingAbove: 4.2
},
new go.Binding("text", "icon").makeTwoWay()
),
$(go.TextBlock,
{
column: 1,
name: "EditAttributeBlock",
stroke: "#333333",
height: 24,
editable: true,
isMultiline: false,
verticalAlignment: go.Spot.LeftCenter,
stretch: go.GraphObject.Horizontal
},
new go.Binding("text", "label").makeTwoWay()
)
)
},
new go.Binding("itemArray", "attributes"),
Now my issue is that when I set the stretch on the TextBlock in column 1, then the table gets ‘oversized’. Since the column 1’s width computes to 100% of the available width and column 0 and column 2 have a fixed width of 30px, the table ends up being 100% of the container width + 60px.
How do I make it fit into the available width as an HTML table would do? Thank you!