YUI Library Examples: Button Control: Calendar Split Button

Button Control: Calendar Split Button

This example demonstrates how to create a Split Button whose menu displays a Calendar. Selecting a date from the Calendar updates the label of the Button to reflect the currently selected date.

Begin by instantiating a Button of type "menu" and an Overlay instance that will house a Calendar instance.

Once the new Button is created, add a listener for its "option" event that will be used to render its Overlay as well as to create a new Calendar instance. (Defering the rendering of the Overlay until the firing of the "option" event improves the intial load time of the Button instance.)

Copyright © 2007 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings