« Return to Thread: Help: YUI Button Menu -> MenuItem Click Event

Re: Help: YUI Button Menu -> MenuItem Click Event

by Todd Kloots :: Rate this Message:

Reply to Author | View in Thread

Michael -

Use the Button's "getMenu" method to retrieve the YUI Menu instance for
the Button.  From there, you can subscribe to it's "click" event as
detailed on the Menu landing page.  For example:

oButton.getMenu().subscribe("click", function (type, args) {

// Your code here

});

- Todd

Michael She wrote:

>
> Hi all,
>
> I have setup my Button Menu declaratively using markup as follows:
>
> <input type="button" id="DialButton"
> name="DialButton" value="Dial" />
> <select id="DialButtonMenu" name="DialButtonMenu">
> <option value="">Home</option>
> <option value="">Office</option>
> <option value="">Mobile</option>
> <option value="">Other</option>
> <option value="">Custom</option>
> </select>
>
> How do I capture the menu item click?
>
> I tried adding a "selectedItemChange" event to the DialButton, but it
> captures MouseOvers/Hovers/Outs as well.
>
> Anyway to just capture the click (i.e. when Home/Office/Other is
> selected?)
>
> Thanks!!!
>
>  

 « Return to Thread: Help: YUI Button Menu -> MenuItem Click Event