Hello,
i need some help regarding a problem with the context-menu. i am total new with the framework so maybe my question sounds a little stupid. sorry for that.
When an entry in the context menu is clicked twice (kind of double-click) the app has a problem with the request that is still beeing executed by the first click.
So how can i disable a context menu-entry inside a click handler. We are using typescript.
The handler starts with
private OnMenuItemSelect(event: ContextMenuSelectEvent): boolean {
const item = $(event.item);
const menuItemId = this.GetMenuItemIdFrom(item);
if (menuItemId == null) {
return true;
}
const menuItem = this.GetMenuItemById(menuItemId);
if (menuItem == null) {
return true;
}
How can i access the clicked entry and disable it ?
Hi Bernd,
I am not sure about the exact scenario and ContextMenu configuration on your side. However, as far as I understand you need to disable the default behavior when an item in the ContextMenu is clicked a second time. If this is the issue I would suggest when an item is clicked add a custom class to it. Then if the same item is clicked again to prevent the default behavior. you can also remove the custom class, so in case the same item is clicked again to execute again the logic that is implemented for the 'first click'.
As you will see in the Dojo example linked here when an item is clicked for a first time a message will be logged in the console. When the same item is clicked second time an alert will appear.
Regards, Neli