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

Re: Splitbutton and events

Expand Messages
  • Willem Joosten
    ... Todd, In version 2.2.2 the init event is removed from Button. So the approach used in the example you give doesn t work anymore. Is there a new approach to
    Message 1 of 4 , May 10, 2007
    View Source
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, Todd Kloots <kloots@...> wrote:
      >
      > In the meantime, here is an example how you can hook up all of your
      > event listeners in the body of a "init" event handler:
      >
      > http://yuiblog.com/sandbox/yui/v220/examples/button/example03.php
      >

      Todd,

      In version 2.2.2 the init event is removed from Button. So the
      approach used in the example you give doesn't work anymore. Is there a
      new approach to add event listeners to the menu / menu items?

      I tried to the following (using a input and select in html):

      var button = new YAHOO.widget.Button('btnProjectSelector', { type:
      'menubutton', menu: 'projectMenu');
      YAHOO.util.Event.onContentReady('projectMenu', function(){
      initProjectMenu(); });

      The idea is that the menu initialisation in button is triggered by the
      same onContentReady event. So if events are fired in order they're
      created this should work.

      But initProjectMenu is never fired. When you switch the two lines it
      is fired so the code is ok. The problem is the removal of the original
      select item (line 1074 in button-beta.js)

      Regards,
      Willem
    Your message has been successfully submitted and would be delivered to recipients shortly.