Hi folks,
I’m trying to edit a textblock (the value 1000, simple in theory) but I can’t manage to do it. No msg, no errors but the textblock remains uneditable. Here’s my code (just for the green node) :
myDiagram.nodeTemplateMap.add("COSVAL",
$gj(go.Node, "Vertical",
{
isTreeExpanded: true,
defaultStretch: go.GraphObject.Horizontal,
isShadowed: true,
shadowColor: "lightgrey",
shadowOffset: new go.Point(4,4),
dragComputation: stayInGroup
},
new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
new go.Binding("text", "text"),
$gj(go.Panel, "Auto",
$gj(go.Shape, "RoundedTopRectangle",
{
portId: "totale",
fill: "#22AA99",
stroke: "white",
strokeWidth: 1,
fromSpot: go.Spot.Right,
toSpot: go.Spot.Left,
fromLinkable: false,
toLinkable: true,
toMaxLinks: 1,
cursor: "pointer"
}),
$gj(go.TextBlock,
{
margin: new go.Margin(5, 2, 5, 2),
textAlign: "center",
stroke: "white",
font: "bold 12pt sans-serif"
},
new go.Binding("text", "text")
)
),
$gj(go.Panel, "Auto",
{
minSize: new go.Size(160, 20)
},
$gj(go.Shape, "Rectangle",
{
fill: "#22AA99",
stroke: "white",
strokeWidth: 1,
}
),
$gj(go.TextBlock,
{
editable: true,
margin: new go.Margin(2, 2, 2, 10),
stroke: "white",
font: "bold 12pt sans-serif"
},
new go.Binding("text", "valo").makeTwoWay()
//new go.Binding("text", "valo")
)
),
$gj(go.Panel, "Auto",
$gj(go.Shape, "RoundedBottomRectangle",
{
fill: "#22AA99",
stroke: "white",
strokeWidth: 1
}
//new go.Binding("fill", "role", function(r) { return r[0] === 'b' ? "lightgray" : "white"; })
),
$gj(go.Panel, "Table",
$gj(go.Picture, BASE_URL+"img/value.png",
{
row: 0,column: 0,
width: 12, height: 12, scale: 2.0,
margin: new go.Margin(5, 2, 5, 2),
}),
$gj(go.TextBlock, "VALORE",
{
row: 0, column: 1,
margin: new go.Margin(2, 2, 2, 10),
editable: false,
maxSize: new go.Size(80, 40),
stroke: "white",
font: "bold 9pt sans-serif"
}
)
)
)
)
);
and here’s the result in graphic:
I followed the GoJS Validation -- Northwoods Software example but I don’t understand what’s missing…
pls help thanks in advance
F