#2 your suggestion worked, but I realised that i need to create my own link class, in order to be able to define the link point.
Based on this example I have created my own link class which extends go.Link and I have overwritten the getLinkPoint function. It works with a simple node. I use the port parameter to determine the rectangle and calculate the link points.
I have added a table, bound an itemArray and created a TableColumn template. I have set the link-properties on the TableColumn. When I create a link to or from a column the column is highlighted.
The problem now is that no matter to or from which column I drag the link, rectangle defined by the parameter port in the function getLinkPoint is always the most right column. The result is that the links are always “connected” to the most right column.
How can I get the correct column in the getLinkPoint (the column where I have dragged the link with the mouse)?
It sounds as if the link really is connecting with the port on the right. That’s odd. Can you confirm that (for that node) there are three ports? If you select that Node:
myDiagram.selection.first().ports.count
If that indeed evaluates to 3, have you set GraphLinksModel.linkFromPortIdProperty and GraphLinksModel.linkToPortIdProperty?
Three elements have GraphObject.portId set to a string, but because you set them all to the same string, the ports do not have unique identifiers, so it’s ambiguous. I guess Node.port happens to get what you think of as the last one.