Unable to add custom context menu items to Diagram Context Menu

I am trying to override the the context menu settings on my diagram component but it seems like I am unable to access the correct ContextMenuItemsModel[] interface(items property) on the ContextMenuSettings Interface. The only visible property on the ContextMenuItemsModel seems to be "target". I am sure why this is happening. I don't see anything in the documentation about this. All the examples are using items property of ContextMenuItemsModel but it doesn't seem to be available in my version. I am using version 19.1.67 of synfusion/ej2-angular-diagrams and have done all the proper imports and add the provider services. Could someone please help me out with this issue. Thanks.
// the items property will only allow me to enter a target property and fails to recognize the text or id fields as valid properties.
public contextMenuSettings: ContextMenuSettings = {
show: true,
items: [{
text: 'Edit',
id: 'nodeEdit',
target: '.e-diagramcontent'
},
{
text: 'Information',
id: 'nodeInfo',
target: '.e-diagramcontent'
},
{
text: 'Help',
id: 'nodeHelp',
target: '.e-diagramcontent'
},
{
text: 'Information',
id: 'bufferInfo',
target: '.e-diagramcontent'
},
{
text: 'Validation Messages',
id: 'validationMsgs',
target: '.e-diagramcontent'
}
],
showCustomMenuOnly: true,
};

3 Replies 1 reply marked as answer

GG Gowtham Gunashekar Syncfusion Team June 10, 2021 12:38 PM UTC

Hi Teddy, 
 
Please refer to the following sample for how to create a custom content menu with the shared code. On the further analysis on the shared details, we found you have imported the ContextMenuItemsModel from “synfusion/ej2-angular-diagrams” but you supposed to import  ContextMenuItemsModel from “@syncfusion/ej2-diagrams”.  
 
Code snippet: 
import {  ContextMenuSettingsModel } from '@syncfusion/ej2-diagrams'; 
 
 
 
 
 
we will consider your suggestion to provide exact information on context menu import modules in our documentation. We have logged a documentation improvement task for your suggestion and We will include the documentation changes on or before 29th June 2021. We will let you know once the documentation gets refreshed in live. 
 
Regards, 
Gowtham 



GG Gowtham Gunashekar Syncfusion Team June 29, 2021 01:40 PM UTC

Hi Teddy, 
 
Sorry for the inconvenience caused. Due to some technical issue, we are not able to include the fix for the issue in this week patch release. We will include the documentation changes on or before 6th July 2021. We will let you know once the documentation gets refreshed in live.  
 
Regards, 
Gowtham 



GG Gowtham Gunashekar Syncfusion Team July 6, 2021 12:41 PM UTC

Hi Teddy, 
 
We have made the changes in documentation and the documentation has been refreshed and published in live site. Please find the published documentation changes in below link 
  
 
Regards 
Gowtham 


Marked as answer
Loader.
Up arrow icon