Diagram Context Menu

I cannot get the context menu to show in my application. I'm following the example here but it doesn't appear to work in the demo. https://ej2.syncfusion.com/react/documentation/diagram/context-menu/

Can someone please give me an example on how to allow the context menu to show in the diagram. 

7 Replies 1 reply marked as answer

AR Aravind Ravi Syncfusion Team October 7, 2020 08:51 AM UTC

Hi David, 
 
We have created a sample to open a context menu for the node. We suspect that context menu does not gets open because the id of the diagram element and id of the diagram’s parent element is same. The context menu cannot open if the 'id' for the diagram component is same as the parent of the diagram component. So, if the 'id' property is the same, please rename the 'id' to any of the elements. Please refer below code snippet 
 
<DiagramComponent id="diagramSample" width={"100%"} height={"645"} contextMenuSettings={{ show: true }}  
    nodes = { node } connectors = { connector } 
> 
              <Inject services={[ 
            DiagramContextMenu 
        ]}/> 
            </DiagramComponent> 
 
render(<KeyBoardInteraction />, document.getElementById('diagram')); 
 
  
Please refer to the demo sample of the context menu in the diagram. 
 
Regards 
Aravind Ravi 


Marked as answer

DH David H October 30, 2020 02:50 AM UTC

Thank you for the feedback. The context menu now shows, but I cannot change it. Here are my original context menu settings.

contextMenuSettings = {
    //Enables the context menu
    show: true,
    items: [
      {
        text: "Exclude Ctrl+E",
        id: "exclude",
      },
      {
        text: "Copy Ctrl+C",
        id: "copy",
      },
      {
        text: "Paste Ctrl+V",
        id: "paste",
      },
      {
        text: "Group Ctrl+G",
        id: "group",
      },
      {
        text: "Delete Delete",
        id: "delete",
      },
    ],
    // Hides the default context menu items
    showCustomMenuOnly: true,
  };

When I try to add more items to the list, it only shows the five I added initially. How can I get the items to refresh?  

Thank you, 

Dave



AR Aravind Ravi Syncfusion Team November 2, 2020 04:10 AM UTC

Hi David, 

We are validating your requirements and update you with more details on November 4th 2020. 

Regards 
Aravind Ravi 



AR Aravind Ravi Syncfusion Team November 5, 2020 01:25 PM UTC

Hi David,    
    
Reported Issue : Context Menu items does not gets change at run time 
      
We can reproduce the issue and confirmed this as a defect. We have logged a defect report for this issue. We will fix this issue and provide the patch on November 24th 2020 weekly patch release.    
  
    
Regards,    
Aravind Ravi  




DH David H November 5, 2020 01:53 PM UTC

Thank you!


AR Aravind Ravi Syncfusion Team November 6, 2020 04:25 AM UTC

Hi David, 

Most welcome. As we said earlier, We will fix this issue and provide the patch on November 24th 2020 weekly patch release.     

     
Regards 
Aravind Ravi 



AR Aravind Ravi Syncfusion Team November 24, 2020 01:05 PM UTC

Hi David,   
 
We have fixed the reported issue and included it in our patch release (v18.3.51) which is rolled out successfully.      
      
Please upgrade to the latest version packages to resolve this issue.            
     
Regards,     
Aravind Ravi    


Loader.
Up arrow icon