To confirm a delete menu item i set the following function on the OnClientContextMenuItemClicking event.
function TreeMenuClick(sender, eventArgs){
if (eventArgs.get_menuItem().get_value() == "Delete") {
if (!confirm("Do you want to delete the selected Item?")) {
eventArgs.set_cancel(true);
}
}
}
When cancel is selected in the confirm dialog the context menu remains displayed. I tried the following command, but it did not make any difference.
eventArgs.get_menuItem().get_menu().close();
Any idea how you get the menu to close.
function TreeMenuClick(sender, eventArgs){
if (eventArgs.get_menuItem().get_value() == "Delete") {
if (!confirm("Do you want to delete the selected Item?")) {
eventArgs.set_cancel(true);
}
}
}
When cancel is selected in the confirm dialog the context menu remains displayed. I tried the following command, but it did not make any difference.
eventArgs.get_menuItem().get_menu().close();
Any idea how you get the menu to close.