Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7420

Textblock doesn't bind text property

$
0
0

@MJ wrote:

I want to change text on node automatically.

So I tried below ,

this.myDiagram.nodeTemplateMap.add("Param",
$(go.Node, "Auto",
$(go.Shape, "Rectangle",
{ fill: "#f68f3a", width:120, height: 30,stroke: null },
new go.Binding("fill", "color")),
$(go.TextBlock,'Parameter',
{
margin: 5,
editable: true,
font: "bold 13px sans-serif",
opacity: 0.75,
stroke: "#404040"
},
new go.Binding("text", "text").makeTwoWay())
));

and where I want to occur change text ,

this.myDiagram.model.startTransaction("textchange")
var node = this.myDiagram.findNodeForKey(val.key)
this.myDiagram.model.setDataProperty(node.data, "text", val.paramNm)
this.myDiagram.model.commitTransaction("textchange")

When I check node data(this.myDiagram.mode.toJson()), "text" property is changed, but text on the diagram(node) is not change..

There is no error on console.

How can I fix it?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7420

Trending Articles