Hi Xu zhi bin,
We have checked your reported query, and you set the id
in the items
property of the context menu and got the id from the select
event of the context menu while selecting menu items. Please refer to the below
code snippet and sample.
|
menuItems: [
{
text: "Cut",
id:
"menu1",
iconCss: "e-cm-icons e-cm-cut"
},
{
text: "Copy",
id:
"menu1",
iconCss: "e-cm-icons e-cm-copy"
},
{
text: "Paste",
id:
"menu1",
iconCss: "e-cm-icons e-cm-paste",
}
],
…..
<ejs-contextmenu
cssClass='e-cmenu-wrapper' id="contextmenu1"
ref="contextMenu" target="#contextmenutarget" :items="menuItems"
:beforeItemRender="beforeItemRender" :select="select"></ejs-contextmenu>
……..
select: function(args) {
var
selectedMenuId = args.item.id;
}
|
Sample link: https://stackblitz.com/edit/vkj1gq-8wnhrg?file=src%2FApp.vue
Please let us know if you need any further assistance on this.
Regards,
KeerthiKaran K V