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

Re: Building a drop down

Expand Messages
  • juliebonniedaisy
    Thanks so much Todd, that fixed it.
    Message 1 of 4 , Nov 5, 2009
    • 0 Attachment
      Thanks so much Todd, that fixed it.

      --- In ydn-javascript@yahoogroups.com, Todd Kloots <kloots@...> wrote:
      >
      > You are getting that error because you copy and pasted example code in
      > which I had created an alias (Button) for YAHOO.widget.Button. If I
      > remember that example correctly, at the top you will find:
      >
      > var Button = YAHOO.widget.Button.
      >
      > You can either re-create that alias within the scope that you are
      > creating Button instances, or use the fully qualified namespace
      > YAHOO.widget.Button.
      >
      > - Todd
      >
      > On Nov 5, 2009, at 7:21 AM, kakar0to wrote:
      >
      > > <div id="btn"></div>
      > >
      > > <script type="text/javascript">
      > >
      > > YAHOO.util.Event.onContentReady("btn", function () {
      > >
      > > var ddActionsMenuData = [
      > > { text: "Option 1", value: "menubutton-1" },
      > > { text: "Option 2", value: "menubutton-2" },
      > > { text: "Option 3", value: "menubutton-3" }
      > > ];
      > >
      > > var oMenuButton5 = new YAHOO.widget.Button({
      > > id: "menubutton-1",
      > > name: "menubutton-1",
      > > label: "<em class=\"yui-button-label\">Option 1</em>",
      > > type: "menu",
      > > menu: ddActionsMenuData,
      > > container: this }
      > > );
      > >
      > >
      > > oMenuButton5.on("selectedMenuItemChange", function() { alert("hi");});
      > > });
      > > </script>
      > >
      > > --- In ydn-javascript@yahoogroups.com, "juliebonniedaisy"
      > > <juliebonniedaisy@> wrote:
      > >>
      > >> Any ideas why I get Button is not defined? Button and menu are
      > >> both loading in my yuiloader and they do get loaded.
      > >>
      > >>
      > >> Button is not defined
      > >> [Break on this error] var oMenuButton1 = new Button({ \r\n
      > >>
      > >>
      > >>
      > >> // build drop down menu
      > >> var ddActionsMenuData = [
      > >> { text: "Option 1", value: "menubutton-1" },
      > >> { text: "Option 2", value: "menubutton-2" },
      > >> { text: "Option 3", value: "menubutton-3" }
      > >> ];
      > >>
      > >> var oMenuButton1 = new Button({
      > >> id: "menubutton-1",
      > >> name: "menubutton-1",
      > >> label: "<em class=\"yui-button-label\">Option 1</em>",
      > >> type: "menu",
      > >> menu: ddActionsMenuData,
      > >> container: "ddActions" });
      > >>
      > >> oMenuButton1.render();
      > >> oMenuButton1.on("selectedMenuItemChange", function()
      > >> { alert("hi");});
      > >>
      > >
      > >
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.