This example shows you how to enable and configure the Calendar Navigator, which will allow users to quickly jump to a specific year/month without having to scroll through months sequentially.
You have 2 ways in which you can enable the
CalendarNavigation feature, which is available to both the Calendar and CalendarGroup controls. The easiest way to enable the feature is to simply set the
navigator configuration property to
true as show below:
The above code snippet generates the CalendarGroup with the CalendarNavigator UI enabled, and the default configuration for the CalendarNavigator applied.
If you want to change the default configuration of the CalendarNavigator UI, you can specify a configuration object for the
navigator property. The properties of the configuration object are case sensitive, and are listed below:
For the Calendar instance, we setup the CalendarNavigator with a custom configuration:
NOTE: In the above code examples, we use the simpler version of the constructor, and only pass in the id of the container. We don't pass both an
id and container id argument, as we do with other examples. This is a new constructor format available as of 2.4.0 and can used if you don't need a specific id set on the Calendar table.
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.