Couldn't able to get obj.part.data for particular port in contextClick

Hi, I have tried getting the particular port data on context click on port, Refer the below link I have added context click for left port and it is not working.

I couldn’t tell what your code is that is “not working”. Could you quote the code and describe exactly what the problem is? What is the value of obj at that time?

Is it possible to get the port data in context click,
I wrote contextClick in itemTemplate and I am getting the data of node only and not the data of the respective port. But in contextMenu it is giving the respective port data.

contextClick: function(e, obj) { console.log(obj.part.data) } // Getting the data of the Node

contextMenu: $(go.Adornment, "Vertical",
        makeButton("Swap order",
                   function(e, obj) { swapOrder(obj.part.adornedObject); }))

also tried obj.part.adornedObject in contextClick but it is undefined

Is it possible to get the port data on contextClick of the port.

If obj.part.adornedObjectis your item Panel, you can get it’s .data.

If you put the context menu on an element inside the item panel, you need to go up the panel chain to get that item panel.