syncfusion / ej2-vue-ui-components

Syncfusion Vue UI component library offer more than 50+ cross-browser, responsive, and lightweight vue UI controls for building modern web applications.
https://www.syncfusion.com/vue-ui-components
Other
298 stars 65 forks source link

[Question] How can I show context menu on command button click? #67

Closed sunhillbd closed 3 years ago

sunhillbd commented 3 years ago

Context menu is working in grid on right mouse click, but I've to show the context menu on command button click too.

See image

image

Here is my command click method-

commandClick(args) {   
      let contextMenuObj = this.$refs.grid.ej2Instances.contextMenuModule.contextMenu;   
      contextMenuObj.open(40,20);
}

Getting folowing error

Uncaught TypeError: Cannot read property 'target' of null

Gayathri02-design commented 3 years ago

Hi Nahidul,

Thank you for contacting Syncfusion support.

We have checked your reported query. We can show the contextMenu with command buttons in grid component. So, we have prepared sample in that we have added the click event to the Grid content and also used the commandClick event of the Grid component to show the contextMenu with command buttons. Please check the sample.

Sample Link: https://codesandbox.io/s/vue-template-forked-k54d0?file=/src/App.vue:4156-4783

Please get back to us if you need further assistance.

Regards, Gayathri K

sunhillbd commented 3 years ago

Hello @Gayathri02-design ,

Thank you for your quick support.