Loading ...
Sorry, an error occurred while loading the content.

How to find which subitem belongs to which menu

Expand Messages
  • dean.grubb
    Hi, In a menubar how can you find out which submenu items belong to which main menu when clicked on? So far I have this. function onMenuBarClick(p_sType,
    Message 1 of 1 , Aug 31, 2007
    • 0 Attachment
      Hi,

      In a menubar how can you find out which submenu items belong to which
      main menu when clicked on? So far I have this.

      function onMenuBarClick(p_sType, p_aArgs) {
      var oEvent = p_aArgs[0];
      oMenuItem = p_aArgs[1];

      // Returns the text of the menu item that was clicked on
      txt = oMenuItem.cfg.getProperty("text");

      // Returns the main menu items
      var mmItems = oMenuBar.getItems();
      var numItems = oMenuBar.getItems().length;

      // Returns the number of sub items in each main menu
      for (var i = 0; i <= numItems-1; i++)
      {
      p = oMenuBar.getItem(i).cfg.getProperty("submenu").getItems();
      p.length // number of items in each submenu
      };

      };

      I can't figure out which menu oMenuItem belongs too.
    Your message has been successfully submitted and would be delivered to recipients shortly.