Articles in this section
Category / Section

Is it possible to have the context menu by right clicking the node?

1 min read

 

Display context menu on a selected Node

It is possible to display context menu on a selected node. To display the context menu on the selected node and add it to new nodes, following JavaScript should be used.

// To display the contextmenu
function attachevent()
{
document.getElementById('DiagramWebControl1').oncontextmenu=function()
{
PosX = ConvertXYToDocument( Diagram.GetRootElement(), event.clientX, event.clientY, Diagram.GetMagnification() ).x;
PosY = ConvertXYToDocument( Diagram.GetRootElement(), event.clientX, event.clientY, Diagram.GetMagnification() ).y;
Popup.ShowPopup(event.clientX, event.clientY);
return false;
};
}
function OnContextMenuClick(Obj)
{
if(Obj.Text!="Edit")
{
Diagram.Refresh(Obj.Text+"|"+PosX+''|''+PosY);
}
else if(IsNodeSelected)
{
alert(''Not implemented'')
}
else
{
alert("Please select a Node to Edit");
}
return false;
}
 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied