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

custom class for YUI menubutton menu

Expand Messages
  • rolfsf
    I m using a menubutton with YUI 2.6.0 I can add a custom class to the button with this: var oMenuButton = new YAHOO.widget.Button({ type: menu , label:
    Message 1 of 3 , Apr 27 3:43 PM
    View Source
    • 0 Attachment
      I'm using a menubutton with YUI 2.6.0

      I can add a custom class to the button with this:
      var oMenuButton = new YAHOO.widget.Button({ type: "menu",
      label: "-Select One-",
      name: "mymenubutton",
      menu: aMenuButtonMenu,
      className: "myCustomClass",
      container: this });

      and I can add custom classes to my menu items like this:
      var aMenuButtonMenu = [
      { text: "Option1", value: 1, classname:"CustomClass1", onclick: { fn: onMenuItemClick } },
      { text: "Option2", value: 2, classname:"CustomClass2", onclick: { fn: onMenuItemClick } }
      ];

      but how do I configure the menu container itself to have a custom class when using this?
    • Todd Kloots
      rolfsf - Did you try using Button s menuclassname configuration attribute?
      Message 2 of 3 , Jun 2, 2009
      View Source
      • 0 Attachment
        "rolfsf" -

        Did you try using Button's "menuclassname" configuration attribute?

        http://developer.yahoo.com/yui/docs/YAHOO.widget.Button.html#config_menuclassname

        var oMenuButton = new YAHOO.widget.Button(
        {
        type: "menu",
        label: "-Select One-",
        name: "mymenubutton",
        menu: aMenuButtonMenu,
        className: "myCustomClass",
        menuclassname: "myCustomMenuClass"
        container: this
        });

        - Todd



        On Apr 27, 2009, at 3:43 PM, rolfsf wrote:

        >
        >
        > I'm using a menubutton with YUI 2.6.0
        >
        > I can add a custom class to the button with this:
        > var oMenuButton = new YAHOO.widget.Button({ type: "menu",
        > label: "-Select One-",
        > name: "mymenubutton",
        > menu: aMenuButtonMenu,
        > className: "myCustomClass",
        > container: this });
        >
        > and I can add custom classes to my menu items like this:
        > var aMenuButtonMenu = [
        > { text: "Option1", value: 1, classname:"CustomClass1", onclick:
        > { fn: onMenuItemClick } },
        > { text: "Option2", value: 2, classname:"CustomClass2", onclick:
        > { fn: onMenuItemClick } }
        > ];
        >
        > but how do I configure the menu container itself to have a custom
        > class when using this?
        >
        >
        >
      • rolfsf
        Thanks for the tip, todd. I haven t looked at this in a month, but when I have a chance I ll see if that will work (never had a chance to finish the idea)
        Message 3 of 3 , Jun 2, 2009
        View Source
        • 0 Attachment
          Thanks for the tip, todd. I haven't looked at this in a month, but when I have a chance I'll see if that will work (never had a chance to finish the idea)


          --- In ydn-javascript@yahoogroups.com, Todd Kloots <kloots@...> wrote:
          >
          > "rolfsf" -
          >
          > Did you try using Button's "menuclassname" configuration attribute?
          >
          > http://developer.yahoo.com/yui/docs/YAHOO.widget.Button.html#config_menuclassname
          >
          > var oMenuButton = new YAHOO.widget.Button(
          > {
          > type: "menu",
          > label: "-Select One-",
          > name: "mymenubutton",
          > menu: aMenuButtonMenu,
          > className: "myCustomClass",
          > menuclassname: "myCustomMenuClass"
          > container: this
          > });
          >
          > - Todd
          >
          >
          >
          > On Apr 27, 2009, at 3:43 PM, rolfsf wrote:
          >
          > >
          > >
          > > I'm using a menubutton with YUI 2.6.0
          > >
          > > I can add a custom class to the button with this:
          > > var oMenuButton = new YAHOO.widget.Button({ type: "menu",
          > > label: "-Select One-",
          > > name: "mymenubutton",
          > > menu: aMenuButtonMenu,
          > > className: "myCustomClass",
          > > container: this });
          > >
          > > and I can add custom classes to my menu items like this:
          > > var aMenuButtonMenu = [
          > > { text: "Option1", value: 1, classname:"CustomClass1", onclick:
          > > { fn: onMenuItemClick } },
          > > { text: "Option2", value: 2, classname:"CustomClass2", onclick:
          > > { fn: onMenuItemClick } }
          > > ];
          > >
          > > but how do I configure the menu container itself to have a custom
          > > class when using this?
          > >
          > >
          > >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.