Put the linked record into textfield

hi i'm just to use mapping fields of record like this.

http://www.gojs.net/latest/samples/records.html

how can i get the value of field that i linked and put it into textfield or or alert the field that i linked.? for ex. if i linked from field 1 in record1 to fieldA in record2. so i want to put field1 into textfield A and fieldA into textfield B. i have try to pluck the value of formPort and toPort in linkdataArray but it failed.

What is it that you want to accomplish? As that sample shows, when the user draws a new link, the LinkingTool puts a new link data object in the GraphLinksModel.linkDataArray. And that JavaScript object has all four properties sufficient to identify both ends of the connections to ports on nodes.

The “LinkDrawn” DiagramEvent is raised when a user finishes drawing a new link, so you could look at the new Link’s data’s properties.

Or you could implement a Changed listener on the Diagram.model, and look for a ChangedEvent.change === go.ChangedEvent.Insert and ChangedEvent.modelChange === “linkDataArray” in order to detect when a new link data object is added to the linkDataArray. That will cover all cases where that happens, not just when the user draws a new link using the LinkingTool.

it works with ChangedEvent.modelChange === “linkDataArray” . thx with your suggestion Smile