Binding error: cannot modify on Picture


Here is a part of the template who cause the issue

        {margin: 1, width: 24, height: 24, alignment: go.Spot.TopLeft},
        new go.Binding('source', 'flowDirectionIcon'),
        new go.Binding('name', 'key'),
              $(go.TextBlock, {margin: 3},
                new go.Binding('text', 'flowDirectionIconTooltip')
          click: (e: any, thisObj: go.GraphObject) => {
            const twin = findNode(twinNode(, e.diagram.nodes);
            if(twin == null) return;
            focusOnNode(twin, e.diagram);

I am binding the key to

The property is meant to allow calls to Panel.findObject to retrieve a particular element of a Panel such as a Node.

It does not make sense for any GraphObject’s name to change dynamically, because code would not know which name to use in a call to findObject on a Node or item Panel.

Think of the “name” property in a Node like the “id” property in HTML DOM and Panel.findObject like getElementById.

I agree but how am I supposed to give it a name dynamically (I don’t want to change his name) but as long as it is a part of a bigger template

What are you trying to accomplish?

I want to get the key in the click in order to find a specific node related to him

  click: (e, obj) => alert(obj.part.key)