Posted 4 September 2024, 7:02 am EST
Hi Abhijeet,
You can use ‘wj-state-disabled’ class on the item, which essentially disables the menu items.
this.menu.isDroppedDownChanging.addHandler(
(s: input.Menu, e: CancelEventArgs) => {
// here you can use your API calls and assign items to the data
if (!this.items || this.items.length == 0) {
s.listBox.hostElement.children[0].classList.add('wj-state-disabled');
setTimeout(() => {
this.items = ['New', 'Open', 'Close', 'Save'];
}, 2000);
}
}
);
Please go through this updated sample for a better understanding - https://stackblitz.com/edit/angular-mkzkkv?file=src%2Fapp%2Fapp.component.ts
And thank you for your suggestion, we have forwarded this feature request to the engineering team with internal tracking ID - WJM-34884. We will update you when this feature is added to the Menu control.
In case you need further assistance do let us know.
Thanks, and regards.