Class YAHOO.widget.CalendarGroup
YAHOO.widget.CalendarGroup is a special container class for YAHOO.widget.Calendar_Core. This class facilitates the ability to have multi-page calendar views that share a single dataset and are dependent on each other.
The calendar group instance will refer to each of its elements using a 0-based index. For example, to construct the placeholder for a calendar group widget with id "cal1" and containerId of "cal1Container", the markup would be as follows:
Defined in: calendar.js.
Constructor Attributes | Constructor Name and Description |
---|---|
YAHOO.widget.CalendarGroup(pageCount, id, containerId, monthyear, selected)
|
Method Attributes | Method Name and Description |
---|---|
addMonthRenderer(month, fnRender)
Calls the addMonthRenderer function of all child calendars within the group.
|
|
addRenderer(sDates, fnRender)
Calls the addRenderer function of all child calendars within the group.
|
|
addWeekdayRenderer(weekday, fnRender)
Calls the addWeekdayRenderer function of all child calendars within the group.
|
|
callChildFunction(fnName, args)
Calls a function within all child Calendars within this CalendarGroup.
|
|
clear()
Calls the clear function of all child calendars within the group.
|
|
constructChild(id, containerId, monthyear, selected)
Constructs a child calendar.
|
|
deselect(date)
Calls the deselect function of all child calendars within the group.
|
|
Calls the deselectAll function of all child calendars within the group.
|
|
deselectCell(cellIndex)
Calls the deselectAll function of all child calendars within the group.
|
|
Gets the list of currently selected dates from the calendar.
|
|
init(pageCount, id, containerId, monthyear, selected)
Initializes the calendar group.
|
|
Calls the nextMonth function of all child calendars within the group.
|
|
nextYear()
Calls the nextYear function of all child calendars within the group.
|
|
Calls the previousMonth function of all child calendars within the group.
|
|
Calls the previousYear function of all child calendars within the group.
|
|
render()
Calls the render function of all child calendars within the group.
|
|
reset()
Calls the reset function of all child calendars within the group.
|
|
select(date)
Calls the select function of all child calendars within the group.
|
|
selectCell(cellIndex)
Calls the selectCell function of all child calendars within the group.
|
|
setChildFunction(fnName, fn)
Adds a function to all child Calendars within this CalendarGroup.
|
|
setMonth(month)
Sets the calendar group's month explicitly.
|
|
setYear(year)
Sets the calendar group's year explicitly.
|
|
sync(caller)
Synchronizes the data values for all child calendars within the group.
|
|
toString()
Returns a string representation of the object.
|
|
wireEvent(eventName, fn)
Sets an event handler universally across all child calendars within the group.
|
Class Detail
YAHOO.widget.CalendarGroup(pageCount, id, containerId, monthyear, selected)
- Parameters:
- {Integer} pageCount
- The number of pages that this calendar should display.
- {String} id
- The id of the element that will be inserted into the DOM.
- {String} containerId
- The id of the container element that the calendar will be inserted into.
- {String} monthyear
- The month/year string used to set the current calendar page
- {String} selected
- A string of date values formatted using the date parser. The built-in default date format is MM/DD/YYYY. Ranges are defined using MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD. Any combination of these can be combined by delimiting the string with commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"
Method Detail
addMonthRenderer(month, fnRender)
Calls the addMonthRenderer function of all child calendars within the group.
- Parameters:
- month
- fnRender
addRenderer(sDates, fnRender)
Calls the addRenderer function of all child calendars within the group.
- Parameters:
- sDates
- fnRender
addWeekdayRenderer(weekday, fnRender)
Calls the addWeekdayRenderer function of all child calendars within the group.
- Parameters:
- weekday
- fnRender
callChildFunction(fnName, args)
Calls a function within all child Calendars within this CalendarGroup.
- Parameters:
- {String} fnName
- The name of the function
- {Array} args
- The arguments to pass to the function
clear()
Calls the clear function of all child calendars within the group.
{YAHOO.widget.Calendar_Core}
constructChild(id, containerId, monthyear, selected)
Constructs a child calendar. This method can be overridden if a subclassed version of the default
calendar is to be used.
- Parameters:
- {String} id
- The id of the element that will be inserted into the DOM.
- {String} containerId
- The id of the container element that the calendar will be inserted into.
- {String} monthyear
- The month/year string used to set the current calendar page
- {String} selected
- A string of date values formatted using the date parser. The built-in default date format is MM/DD/YYYY. Ranges are defined using MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD. Any combination of these can be combined by delimiting the string with commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"
- Returns:
- The YAHOO.widget.Calendar_Core instance that is constructed
deselect(date)
Calls the deselect function of all child calendars within the group.
- Parameters:
- date
deselectAll()
Calls the deselectAll function of all child calendars within the group.
deselectCell(cellIndex)
Calls the deselectAll function of all child calendars within the group.
- Parameters:
- cellIndex
{Date[]}
getSelectedDates()
Gets the list of currently selected dates from the calendar.
- Returns:
- An array of currently selected JavaScript Date objects.
init(pageCount, id, containerId, monthyear, selected)
Initializes the calendar group. All subclasses must call this method in order for the
group to be initialized properly.
- Parameters:
- {Integer} pageCount
- The number of pages that this calendar should display.
- {String} id
- The id of the element that will be inserted into the DOM.
- {String} containerId
- The id of the container element that the calendar will be inserted into.
- {String} monthyear
- The month/year string used to set the current calendar page
- {String} selected
- A string of date values formatted using the date parser. The built-in default date format is MM/DD/YYYY. Ranges are defined using MM/DD/YYYY-MM/DD/YYYY. Month/day combinations are defined using MM/DD. Any combination of these can be combined by delimiting the string with commas. Example: "12/24/2005,12/25,1/18/2006-1/21/2006"
nextMonth()
Calls the nextMonth function of all child calendars within the group.
nextYear()
Calls the nextYear function of all child calendars within the group.
previousMonth()
Calls the previousMonth function of all child calendars within the group.
previousYear()
Calls the previousYear function of all child calendars within the group.
render()
Calls the render function of all child calendars within the group.
reset()
Calls the reset function of all child calendars within the group.
select(date)
Calls the select function of all child calendars within the group.
- Parameters:
- date
selectCell(cellIndex)
Calls the selectCell function of all child calendars within the group.
- Parameters:
- cellIndex
setChildFunction(fnName, fn)
Adds a function to all child Calendars within this CalendarGroup.
- Parameters:
- {String} fnName
- The name of the function
- {Function} fn
- The function to apply to each Calendar page object
setMonth(month)
Sets the calendar group's month explicitly. This month will be set into the first
page of the multi-page calendar, and all other months will be iterated appropriately.
- Parameters:
- {Integer} month
- The numeric month, from 1 (January) to 12 (December)
setYear(year)
Sets the calendar group's year explicitly. This year will be set into the first
page of the multi-page calendar, and all other months will be iterated appropriately.
- Parameters:
- {Integer} year
- The numeric 4-digit year
{Date[]}
sync(caller)
Synchronizes the data values for all child calendars within the group. If the sync
method is called passing in the caller object, the values of all children will be set
to the values of the caller. If the argument is ommitted, the values from all children
will be combined into one distinct list and set into each child.
- Parameters:
- {YAHOO.widget.Calendar_Core} caller
- The YAHOO.widget.Calendar_Core that is initiating the call to sync().
- Returns:
- Array of selected dates, in JavaScript Date object form.
{string}
toString()
Returns a string representation of the object.
wireEvent(eventName, fn)
Sets an event handler universally across all child calendars within the group. For instance,
to set the onSelect handler for all child calendars to a function called fnSelect, the call would be:
calGroup.wireEvent("onSelect", fnSelect);
- Parameters:
- {String} eventName
- The name of the event to handler to set within all child calendars.
- {Function} fn
- The function to set into the specified event handler.