Update TextBlock of a Node


In a doubleClick function I am updating node properties using the data operator,

e.g.: node.data.name = “new_name”.

One of the properties I want to update relates to the TextBlock of the node, so:

node.data.text = “new_text”.

This does not however update the node text in the diagram, how do I refresh/update the diagram information?

Node textBlock looks like:

GOG(go.TextBlock, { margin: 1, alignment: go.Spot.Top },

new go.Binding("text", "text")),



See the section about “Modifying Models” in http://gojs.net/latest/intro/usingModels.html .

Basically, start a transaction, call Model.setDataProperty (and any other changes you want to make), and then commit the transaction.

Can you elaborate on this with some example code?


Search the samples and documentation for calls to setDataProperty.