Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
UltraWebMenu top menu item does not auto-dismiss on click
posted

version 20073CLR20
When the user clicks on an expanded top menu item of a horizontal UltraWebMenu with a WebStandard WebMenuStyle, the menu items below do not disappear.  This is not the same behavior as a standard windows forms menu (try the File menu in Microsoft Word 2003).

I have a bit of a workaround by setting an menuIsDisplayed boolean in the MenuClientSideEvents SubMenuDisplay javascript function.  I check the menuIsDisplayed boolean in the MenuClientSideEvents ItemClick javascript function; if the menuIsDisplayed boolean is true, then I dismiss the menu.  If the user then clicks the top menu item again, the SubMenuDisplay javascript function does not fire.  If the user moves the mouse on the top menu item, the SubMenuDisplay javascript function does fire.  This behavior will force me to programmatically show the menu items in the ItemClick javascript function.

Questions:
1. Why don't the items disappear when the user clicks a top menu item in a horizontal UltraWebMenu (like Microsoft Word 2003)?
2. Is there a way to show the menu items in the ItemClick javascript function when the top menu item of a horizontal UltraWebMenu is clicked?


JAVASCRIPT WORKAROUND:

var menuIsDisplayed=false;

function subMenuDisplay(menuId, subMenuId, bDisplay)
{
  menuIsDisplayed = bDisplay;
}

function itemClick(menuId, itemId)
{
  var menuItem, tagName;
 
  menuItem = igmenu_getItemById(itemId);
  tagName = menuItem.getTag();
 
 switch(tagName)
 {
 case 'mnuFile':
  if (menuIsDisplayed)
  {
    igmenu_getMenuById(menuId).dismiss();
  }
  else
  {
    //WOULD LIKE TO PROGRAMMATICALLY SHOW THE MENU ITEMS FOR THE FILE MENU HERE
  }
  break;
 default:
 }
}