BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
In my Angular Menu I'm trying to disable an option in the menu but it is not working. I have created a Stackblitz to reproduce the issue https://stackblitz.com/edit/angular-5mdywsmu-xassqaje?file=src%2Fapp.component.ts .
Notice in the example that when the menu is created I call the enableItems function with the value false to disable one of the options in the menu but that option is not disabled.
Is this a bug or is there something I'm missing?
Hi Anthony,
We have reviewed your reported query with the menu component; based on our menu component architecture, we have created a new li element for every sub-menu opening action. So while handling the enable/disable-related action for the submenu, kindly handle it in the beforeOpen event of the Menu component. We have already provided the sample for enable/disable-related codes in our UG documentation. Refer to the below links and code snippet.
<ejs-menu #menu [items]='menuItems' (created)='created()' (beforeOpen)='beforeOpen($event)'></ejs-menu> …. public beforeOpen(args: BeforeOpenCloseMenuEventArgs): void { for (let i: number = 0; i < args.items.length; i++) { if (['1'].indexOf(args.items[i].id as string) > -1) { this.menu?.enableItems([args.items[i].id as string], false, true); } } |
Sample link: https://stackblitz.com/edit/angular-5mdywsmu-wk21cphm?file=src%2Fapp.component.ts
Please let us know if you need any further assistance on this.
Regards,
YuvanShankar A
I have confirmed that making the method call in the beforeOpen handler results in the expected behavior. Thanks.
Hi Anthony,
Thank you for the update. Please get back to us if you need any further assistance.
Regards,
Priyanka K