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

Removing menu items from context menu

Expand Messages
  • Panthera leo
    I have created a context menu and added a few commands to it... for now the commands are just plain text. I would like to know as to how I would remove all
    Message 1 of 2 , Sep 2, 2006
    • 0 Attachment
      I have created a context menu and added a few commands to it... for now
      the commands are just plain text. I would like to know as to how I
      would remove all commands from a context menu at a time...I checked the
      apidoc and found out oMenu.removeItem() must be used, but I do not know
      the maximum number of menu Items that the menu holds...Is there a way
      to get the maximum number of menu Items that the menu holds..

      Thanks

      Vijai
    • Todd Kloots
      Vijai - You can use getItemGroups to retrieve the number of items in your ContextMenu instance. Assuming your menu has only one group of items, the code
      Message 2 of 2 , Sep 6, 2006
      • 0 Attachment
        Vijai -

        You can use "getItemGroups" to retrieve the number of
        items in your ContextMenu instance. Assuming your
        menu has only one group of items, the code would look
        something like this:

        oContextMenu.getItemGroups()[0].length

        This method is documented here:

        http://developer.yahoo.com/yui/docs/menu/YAHOO.widget.MenuModule.html#getItemGroups

        Hope that helps you.

        - Todd

        --- Panthera leo <voodoo_6600@...> wrote:

        > I have created a context menu and added a few
        > commands to it... for now
        > the commands are just plain text. I would like to
        > know as to how I
        > would remove all commands from a context menu at a
        > time...I checked the
        > apidoc and found out oMenu.removeItem() must be
        > used, but I do not know
        > the maximum number of menu Items that the menu
        > holds...Is there a way
        > to get the maximum number of menu Items that the
        > menu holds..
        >
        > Thanks
        >
        > Vijai
        >
        >
        >
        >
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        > ydn-javascript-unsubscribe@yahoogroups.com
        >
        >
        >
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.