dojox.calendar.CalendarBase
Object » dijit._WidgetBase » dojox.calendar.CalendarBase
This class defines a generic calendar widget that manages several views to display event in time.
dojox.calendar.StoreMixin
Property Summary
- views The views displayed by the widget. To add/remove only one view, prefer, respectively, the addView() or removeView() methods.
Method Summary
- _applyAttributes()
- _computeCurrentView(startDate, endDate, duration) If the time range is lasting less than seven days returns the column view or the matrix view otherwise.
- _computeVisibleItems(renderData) Computes the data items that are in the displayed interval.
- _configureView(view, index, timeInterval, duration) Configures the view to show the specified time interval. This method is computing and setting the "startDate", "columnCount" for a column view, "startDate", "columnCount", "rowCount", "refStartTime" and "refEndTime" for a matrix view. This method can be extended to configure other properties like layout properties for example.
- _createDefaultViews() Creates the default views. This method does nothing and is designed to be overridden.
- _getCurrentViewAttr()
- _getViewsAttr()
- _initItems(items)
- _navigate(dir)
- _onViewAdded(view)
- _onViewRemoved(view)
- _refreshItemsRendering(renderData)
- _setCurrentViewAttr(view)
- _setDateAttr(value)
- _setDateIntervalAttr(value)
- _setDateIntervalStepsAttr(value)
- _setEndDateAttr(value)
- _setFirstDayOfWeekAttr(value)
- _setHoveredItem(item, renderer)
- _setItemsAttr(value)
- _setStartDateAttr(value)
- _setStoreAttr(value)
- _setTextDirAttr(value)
- _setViewsAttr(views)
- _showView(oldView, newView) Displays the current view.
- _updateItems(object, previousIndex, newIndex)
- _validateProperties()
- addView(view, index) Add a view to the calendar's view list.
- buildRendering()
- columnViewColumnHeaderClick(e) Function called when the cell of a column header of the column view is clicked. Show the time range defined by the clicked date.
- computeTimeInterval() Computes the displayed time interval according to the date, dateInterval and dateIntervalSteps if date is not null or startDate and endDate properties otherwise.
- configureButtons() Set the localized labels of the buttons and the event handlers.
- constructor(args)
- cssClassFunc() Optional function that returns a css class name to apply to item renderers that are displaying the specified item in parameter.
- dayButtonClick(e) The action triggerred when the day button is clicked. By default, sets the dateInterval property to "day" and the "dateIntervalSteps" to 1.
- decodeDate() An optional function to transform store date into Date objects. Default is null.
- destroy(preserveDom)
- encodeDate() An optional function to transform Date objects into store date. Default is null.
- floorDate(date, unit, steps, reuse) floors the date to the unit.
- floorToDay(date, reuse) Floors the specified date to the start of day.
- floorToWeek(d) Floors the specified date to the beginning of week. date: Date Date to floor.
- formatItemTimeFunc() Optional function to format the time of day of the item renderers. The function takes the date and render data object as arguments and returns a String.
- fourDaysButtonClick(e) The action triggerred when the 4 days button is clicked. By default, sets the dateInterval property to "day" and the "dateIntervalSteps" to 4.
- getIdentity(item)
- goToday() Changes the displayed time interval to show the current day. Sets the date property to the current day, the dateInterval property to "day" and the "dateIntervalSteps" to 1.
- isItemEditable(item, rendererKind) Computes whether particular item renderer can be edited. By default it is using the editable property value.
- isItemHovered(item) Returns whether the specified item is hovered or not.
- isItemMoveEnabled(item, rendererKind) Computes whether particular item renderer can be moved. By default it is using the moveEnabled property value.
- isItemResizeEnabled(item, rendererKind) Computes whether particular item renderer can be resized. By default it is using the resizedEnabled property value.
- isStartOfDay(d) Tests if the specified date represents the starts of day.
- isToday(date) Returns whether the specified date is in the current day.
- itemToRenderItem(item, store) Creates the render item based on the dojo.store item. It must be of the form: { id: Object, startTime: Date, endTime: Date, summary: String } By default it is building an object using the store id, the summaryAttr, startTimeAttr and endTimeAttr properties as well as decodeDate property if not null. Other fields or way to query fields can be used if needed.
- matrixViewRowHeaderClick(e) Function called when the cell of a row header of the matrix view is clicked. If another row is already expanded, collapse it and then expand the clicked row. If the clicked row is already expadned, collapse it. If no row is expanded, expand the click row.
- monthButtonClick(e) The action triggered when the month button is clicked. By default, sets the dateInterval property to "month" and the "dateIntervalSteps" to 1.
- newDate(obj) Creates a new Date object.
- nextRange()
- postCreate()
- previousRange()
- refreshRendering()
- removeView(view) Removes a view from the calendar's view list.
- renderItemToItem(renderItem, store) Create a store item based on the render item. It must be of the form: { id: Object startTime: Date, endTime: Date, summary: String } By default it is building an object using the summaryAttr, startTimeAttr and endTimeAttr properties and decodeDate property if not null.
- todayButtonClick(e) The action triggered when the today button is clicked. By default, calls the goToday() method.
- updateRenderers(obj, stateOnly)
- weekButtonClick(e) The action triggered when the week button is clicked. By default, sets the dateInterval property to "week" and the "dateIntervalSteps" to 1.
Event Summary
- onColumnHeaderClick(e) Event dispatched when a column header cell is dispatched.
- onCurrentViewChange(e) Event dispatched when the current view has changed.
- onGridClick(e) Event dispatched when the grid has been clicked.
- onGridDoubleClick(e) Event dispatched when the grid has been double-clicked.
- onItemClick(e) Event dispatched when an item renderer has been clicked.
- onItemDoubleClick(e) Event dispatched when an item renderer has been double-clicked.
- onItemEditBegin(e) Event dispatched when the item is entering the editing mode.
- onItemEditBeginGesture(e) Event dispatched when an editing gesture is beginning.
- onItemEditEnd(e) Event dispatched when the item is leaving the editing mode.
- onItemEditEndGesture(e) Event dispatched at the end of an editing gesture.
- onItemEditMoveGesture(e) Event dispatched during a move editing gesture.
- onItemEditResizeGesture(e) Event dispatched during a resize editing gesture.
- onItemRollOut(e)
- onItemRollOver(e)
- onRendererCreated(renderer) Event dispatched when an item renderer has been created.
- onRendererDestroyed(renderer) Event dispatched when an item renderer is destroyed.
- onRendererRecycled(renderer) Event dispatched when an item renderer has been recycled.
- onRendererReused(renderer) Event dispatched when an item renderer that was recycled is reused.
- onRenderersLayoutDone(view) Event triggered when item renderers layout has been done.
- onRowHeaderClick(e) Event dispatched when a row header cell is clicked.
- onTimeIntervalChange(e) Event dispatched when the displayed time interval has changed.
- onViewAdded(view) Event dispatched when a view is added from the calendar.
- onViewRemoved(view) Event dispatched when a view is removed from the calendar.
Attached Objects
Properties
Overrides dijit._WidgetBase
The views displayed by the widget.
To add/remove only one view, prefer, respectively, the addView() or removeView() methods.
Methods
Overrides dijit._WidgetBase
If the time range is lasting less than seven days returns the column view or the matrix view otherwise.
Parameter | Type | Description |
---|---|---|
startDate | Date | The start date of the displayed time interval |
endDate | Date | The end date of the displayed time interval |
duration | Integer | Duration of the return: dojox.calendar.ViewBase The view to display. |
Defined by dojox.calendar.StoreMixin
Computes the data items that are in the displayed interval.
Parameter | Type | Description |
---|---|---|
renderData | Object | The renderData that contains the start and end time of the displayed interval. |
Overrides dijit._WidgetBase
Configures the view to show the specified time interval.
This method is computing and setting the
"startDate", "columnCount" for a column view,
"startDate", "columnCount", "rowCount", "refStartTime" and "refEndTime" for a matrix view.
This method can be extended to configure other properties like layout properties for example.
Parameter | Type | Description |
---|---|---|
view | dojox.calendar.ViewBase | The view to configure. |
index | Integer | The index of the view in the Calendar view list. |
timeInterval | Date[] | The time interval that will be displayed by the view. |
duration | Integer | The duration, in days, of the displayed time interval. |
Overrides dijit._WidgetBase
Creates the default views.
This method does nothing and is designed to be overridden.
Overrides dijit._WidgetBase, dojox.calendar.StoreMixin
Parameter | Type | Description |
---|---|---|
renderData |
Overrides dijit._WidgetBase
Displays the current view.
Parameter | Type | Description |
---|---|---|
oldView | dojox.calendar.ViewBase | The previously displayed view or null. |
newView | dojox.calendar.ViewBase | The view to display. |
Overrides dijit._WidgetBase
Add a view to the calendar's view list.
Parameter | Type | Description |
---|---|---|
view | dojox.calendar.ViewBase | The view to add to the calendar. |
index | Integer | Optional, the index where to insert the view in current view list. |
Overrides dijit._WidgetBase
Function called when the cell of a column header of the column view is clicked.
Show the time range defined by the clicked date.
Parameter | Type | Description |
---|---|---|
e | Object | The column header click event. |
Overrides dijit._WidgetBase
Computes the displayed time interval according to the date, dateInterval and
dateIntervalSteps if date is not null or startDate and endDate properties otherwise.
Overrides dijit._WidgetBase
Set the localized labels of the buttons and the event handlers.
Defined by dojox.calendar.StoreMixin
Optional function that returns a css class name to apply to item renderers that are displaying the specified item in parameter.
Overrides dijit._WidgetBase
The action triggerred when the day button is clicked.
By default, sets the dateInterval property to "day" and
the "dateIntervalSteps" to 1.
Parameter | Type | Description |
---|---|---|
e |
Defined by dojox.calendar.StoreMixin
An optional function to transform store date into Date objects. Default is null.
Defined by dojox.calendar.StoreMixin
An optional function to transform Date objects into store date. Default is null.
Overrides dijit._WidgetBase
Date
floors the date to the unit.
Parameter | Type | Description |
---|---|---|
date | Date | The date/time to floor. |
unit | String | The unit. Valid values are "minute", "hour", "day". |
steps | Integer | For "day" only 1 is valid. |
reuse | Boolean | Whether use the specified instance or create a new one. Default is false. |
Overrides dijit._WidgetBase
Date
Floors the specified date to the start of day.
Parameter | Type | Description |
---|---|---|
date | Date | The date to floor. |
reuse | Boolean | Whether use the specified instance or create a new one. Default is false. |
Overrides dijit._WidgetBase
Floors the specified date to the beginning of week.
date: Date
Date to floor.
Parameter | Type | Description |
---|---|---|
d |
Overrides dijit._WidgetBase
Optional function to format the time of day of the item renderers.
The function takes the date and render data object as arguments and returns a String.
Overrides dijit._WidgetBase
The action triggerred when the 4 days button is clicked.
By default, sets the dateInterval property to "day" and
the "dateIntervalSteps" to 4.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Changes the displayed time interval to show the current day.
Sets the date property to the current day, the dateInterval property to "day" and
the "dateIntervalSteps" to 1.
Overrides dijit._WidgetBase
Boolean
Computes whether particular item renderer can be edited.
By default it is using the editable property value.
Parameter | Type | Description |
---|---|---|
item | Object | The item represented by the renderer. |
rendererKind | String | The kind of renderer. |
Overrides dijit._WidgetBase
Boolean
Returns whether the specified item is hovered or not.
Parameter | Type | Description |
---|---|---|
item | Object | The item. |
Overrides dijit._WidgetBase
Boolean
Computes whether particular item renderer can be moved.
By default it is using the moveEnabled property value.
Parameter | Type | Description |
---|---|---|
item | Object | The item represented by the renderer. |
rendererKind | String | The kind of renderer. |
Overrides dijit._WidgetBase
Boolean
Computes whether particular item renderer can be resized.
By default it is using the resizedEnabled property value.
Parameter | Type | Description |
---|---|---|
item | Object | The item represented by the renderer. |
rendererKind | String | The kind of renderer. |
Overrides dijit._WidgetBase
Boolean
Tests if the specified date represents the starts of day.
Parameter | Type | Description |
---|---|---|
d | Date | The date to test. |
Overrides dijit._WidgetBase
Boolean
Returns whether the specified date is in the current day.
Parameter | Type | Description |
---|---|---|
date | Date | The date to test. renderData: Object The current renderData |
Defined by dojox.calendar.StoreMixin
Object
Creates the render item based on the dojo.store item. It must be of the form:
{
id: Object,
startTime: Date,
endTime: Date,
summary: String
}
By default it is building an object using the store id, the summaryAttr,
startTimeAttr and endTimeAttr properties as well as decodeDate property if not null.
Other fields or way to query fields can be used if needed.
Parameter | Type | Description |
---|---|---|
item | Object | The store item. |
store | dojo.store.api.Store | The store. |
Overrides dijit._WidgetBase
Function called when the cell of a row header of the matrix view is clicked.
If another row is already expanded, collapse it and then expand the clicked row.
If the clicked row is already expadned, collapse it.
If no row is expanded, expand the click row.
Parameter | Type | Description |
---|---|---|
e | Object | The row header click event. |
Overrides dijit._WidgetBase
The action triggered when the month button is clicked.
By default, sets the dateInterval property to "month" and
the "dateIntervalSteps" to 1.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Date
Creates a new Date object.
Parameter | Type | Description |
---|---|---|
obj | Object | This object can have several values: the time in milliseconds since gregorian epoch. a Date instance |
Overrides dijit._WidgetBase
Removes a view from the calendar's view list.
Parameter | Type | Description |
---|---|---|
view | dojox.calendar.ViewBase | The view to remove from the calendar. |
Defined by dojox.calendar.StoreMixin
Object
Create a store item based on the render item. It must be of the form:
{
id: Object
startTime: Date,
endTime: Date,
summary: String
}
By default it is building an object using the summaryAttr, startTimeAttr and endTimeAttr properties
and decodeDate property if not null.
Parameter | Type | Description |
---|---|---|
renderItem | Object | The render item. |
store | dojo.store.api.Store | The store. |
Overrides dijit._WidgetBase
The action triggered when the today button is clicked.
By default, calls the goToday() method.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
The action triggered when the week button is clicked.
By default, sets the dateInterval property to "week" and
the "dateIntervalSteps" to 1.
Parameter | Type | Description |
---|---|---|
e |
Events
Overrides dijit._WidgetBase
Event dispatched when a column header cell is dispatched.
Parameter | Type | Description |
---|---|---|
e | Event | The event has the following properties: index: Integer The column index. date: Date The date displayed by the column. triggerEvent: Event The origin event. |
Overrides dijit._WidgetBase
Event dispatched when the current view has changed.
Parameter | Type | Description |
---|---|---|
e | Event | Object that contains the oldView and newView properties. |
Overrides dijit._WidgetBase
Event dispatched when the grid has been clicked.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched when the grid has been double-clicked.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched when an item renderer has been clicked.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched when an item renderer has been double-clicked.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched when the item is entering the editing mode.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched when an editing gesture is beginning.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched when the item is leaving the editing mode.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched at the end of an editing gesture.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched during a move editing gesture.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched during a resize editing gesture.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched when an item renderer has been created.
Parameter | Type | Description |
---|---|---|
renderer | dojox.calendar._RendererMixin | The renderer created. |
Overrides dijit._WidgetBase
Event dispatched when an item renderer is destroyed.
Parameter | Type | Description |
---|---|---|
renderer | dojox.calendar._RendererMixin | The renderer created. |
Overrides dijit._WidgetBase
Event dispatched when an item renderer has been recycled.
Parameter | Type | Description |
---|---|---|
renderer | dojox.calendar._RendererMixin | The renderer created. |
Overrides dijit._WidgetBase
Event dispatched when an item renderer that was recycled is reused.
Parameter | Type | Description |
---|---|---|
renderer | dojox.calendar._RendererMixin | The renderer created. |
Overrides dijit._WidgetBase
Event triggered when item renderers layout has been done.
Parameter | Type | Description |
---|---|---|
view |
Overrides dijit._WidgetBase
Event dispatched when a row header cell is clicked.
Parameter | Type | Description |
---|---|---|
e |
Overrides dijit._WidgetBase
Event dispatched when the displayed time interval has changed.
Parameter | Type | Description |
---|---|---|
e | Object | An event that contains the oldStartTime, startTime, oldEndTime and endTime properties. |
Overrides dijit._WidgetBase
Event dispatched when a view is added from the calendar.
Parameter | Type | Description |
---|---|---|
view | dojox.calendar.ViewBase | The view that has been added to the calendar. |