Getting property from panel through a contextMenu

I have a table node with two table panels that contain ports, one in column 0 and the other in column 2 (leftmost and rightmost columns).

I have a contextMenu that will display when rightclicking on the table panels containing ports - is there a good way of getting the panel’s column data, so I can see if the panel clicked was the left or right panel?

I’ve tried using things like using obj.panel.column but I keep getting the value 0 :confused:

Edit: Codepen has been modified to reflect the solution

It’s likely that the obj.panel expression might not be evaluating to the element that you think it is. What is the value of obj in your click event handler – in other words, on what did you declare that event handler?

Have you tried evaluating obj.column?

Another possibility is to define two separate contextClick event handlers.

(By the way, no one can see your embedded CodePen.)

Walter, thanks for the tips!
You’re right, the event handler was completely focused on the contextMenu, and not on the elements I needed.

var portContextMenu = $(go.Adornment, "Vertical",
    $("ContextMenuButton", $(go.TextBlock, "Add Port"), 
    {click: function(e, obj) {addRemovePort(e, obj, true)}}
)

function addRemovePort(e, obj, isAdd) {...}

In this case, e and obj will both refer to the contextMenu - the click on the button panel, and the panel as the obj.

obj.part.adornedObject.column was what I needed, where obj is the panel, part is the contextMenu adornment, adornedObject is the original part I needed (Table panel), and column is the property I was interested in.