Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 6969

Unable to get object data on click event in contextMenu

$
0
0

@ash wrote:

Hi team,
Am trying to use contextMenu in my app for floorplanner, but am unable to get the object data on click event when i click anywhere other then my selected object as in “CASE :2”. It worked perfectly when in click on object itself as in “CASE :1”.
Floor%20Planner1
Floor%20Planner2

My code:

$("ContextMenuButton",
        $(go.TextBlock, "ShowFloor"),
        {
            click: function (e, obj) {

                console.log('here1');
                console.log(obj.part.data.startpoint); 
                console.log('here2');
                FloorplanFilesystem.prototype.loadFloorplan(0,obj);
            }
        },
        new go.Binding("visible", "", function (v, obj) {
            if (obj.part.diagram !== null) {
                return obj.part.diagram.selection.count > 0;
            } return false;
        }).ofObject()
    )

And am getting this error:
“Uncaught TypeError: Cannot read property ‘x’ of undefined
at Object.FloorplanFilesystem.loadFloorplanElevation (FloorplanFilesystem.js:729)”

Any help would be appreciated, thanks.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6969

Trending Articles