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.
UG link: https://ej2.syncfusion.com/angular/documentation/menu/how-to/customize-menu-items#enable-or-disable-menu-items
<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