| Package | ardisia.scheduling.calendar |
| Class | public class Calendar |
| Inheritance | Calendar spark.components.supportClasses.SkinnableComponent |
| Implements | mx.managers.IFocusManagerComponent |
The dataProvider accepts a collection of SchedulingData objects. Each SchedulingData object will be used to define renderers. Due to calendar recurrence (repeating events), a single SchedulingData object may define an infinite number of renderers. This is why the start and end time for data must be passed along with the Scheduling Data because the renderer may not have the same start/end date as its associated SchedulingData object.
View the technical documentation on the Ardisia Labs website for more information.
Default MXML PropertydataProvider
| Property | Defined By | ||
|---|---|---|---|
| allowMultipleSelection : Boolean = true
True to enable multiple selection. | Calendar | ||
| autoScrollThreshold : Number = 50
Defines the threshold from the boundaries of the viewport in which to
trigger automatic scrolling during a dragging operation for column
display modes. | Calendar | ||
| columnCount : int
The number of columns to display. | Calendar | ||
| dataProvider : IList
The dataProvider for the chart. | Calendar | ||
| displayMode : String
The current display mode. | Calendar | ||
| dragEnabled : Boolean = true
Enables or disables item renderer dragging. | Calendar | ||
| dragIncrement : Number = 15
The number of minutes that renderers will grow/shrink during drag
(resize) operations for the column display modes. | Calendar | ||
| endTime : Number
The number of minutes to end the calendar display in column based
display modes. | Calendar | ||
| minMinutesDisplayedInViewport : Number
The minimum number of minutes of a day that are displayed in the
viewport for the column based display modes. | Calendar | ||
| primaryTimeIntervalMinutes : Number
The number of minutes for each primary time interval for the column
display modes. | Calendar | ||
| resizeThreshold : int = 6
The number of pixels from the edges of the renderer in the column
display modes that a resize cursor will be displayed and a resize
operation will start on mousedown. | Calendar | ||
| rowCount : int
The number of rows to display. | Calendar | ||
| secondaryTimeIntervalCount : Number
The number of secondary time intervals to draw between primary time
intervals for column based display modes. | Calendar | ||
| selectedData : Vector.<SelectedCalendarData>
The selected calendar data. | Calendar | ||
| selectedPeriod : CalendarPeriod
The time period selected via user interaction. | Calendar | ||
| showFriday : Boolean
Display data for friday. | Calendar | ||
| showMonday : Boolean
Display data for monday. | Calendar | ||
| showSaturday : Boolean
Display data for saturday. | Calendar | ||
| showSunday : Boolean
Display data for sunday. | Calendar | ||
| showThursday : Boolean
Display data for thursday. | Calendar | ||
| showTuesday : Boolean
Display data for tuesday. | Calendar | ||
| showWednesday : Boolean
Display data for wednesday. | Calendar | ||
| startDate : Date
The start date to begin display in the calendar. | Calendar | ||
| startTime : Number
The number of minutes to start the calendar display in column based
display modes. | Calendar | ||
| subColumnsCalendars : ICollectionView
Supply an ICollectionView of CalendarDefinitionData objects to display
each calendar in a sub column within a column for the column modes. | Calendar | ||
| Property | Defined By | ||
|---|---|---|---|
| familyIndexEnd : Number
Holds the last maximum end position value for a family of overlapped
renderers for the column mode. | Calendar | ||
| resizeAxis : Date
For resize dragging, stores the axis (E.G., the start or end depending
on the direction of resize) in minutes. | Calendar | ||
| subColumn : int
Hold the contextual sub column. | Calendar | ||
| Method | Defined By | ||
|---|---|---|---|
getDateMap():Array
Return the protected dateMap array. | Calendar | ||
getStoreData(start:Date, end:Date, searchPhrase:String = null):Array
Returns an array of store data based on the input parameters. | Calendar | ||
Convenient method to invalidate the display list for the item renderers. | Calendar | ||
scrollToTime(minutes:Number):void
Scroll to the passed time for a column based display mode. | Calendar | ||
| Method | Defined By | ||
|---|---|---|---|
addToStore(item:SchedulingData, sort:Boolean = true):void
Adds a SchedulingData object to the local store by creating the
necessary StoreData objects and adding them to the store at the sorted
index. | Calendar | ||
canvasHandler(event:Event):void
Handles events on the canvas used for selected time period dragging for
all display modes. | Calendar | ||
checkForAutoScroll():void
Checks if the mouse is within the autoscroll threshold during drag
operations. | Calendar | ||
clearAutoScroll():void
Clears the auto scrolling timer. | Calendar | ||
columnRendererHandler(event:Event):void
Handles events on the column renderer skin part. | Calendar | ||
dragHandler(event:Event):void
Handles item renderer dragging and resizing. | Calendar | ||
eventHandler(event:Event):void
Handles events on the component. | Calendar | ||
getColumnStartPositions(rendererIndex:int, dayStore:Vector.<StoreData>):void
Sets the layout positions on the store data for the column renderers. | Calendar | ||
getFirstEmptyIndex(arr:Array):int
Returns the first empty index value in the provided array. | Calendar | ||
getMousedGridIndex(canvas:SpriteVisualElement):int
Returns the row/column of where the mouse is located. | Calendar | ||
gridLabelHandler(event:Event):void
Handles events on the grid label skin part. | Calendar | ||
gridOverflowHandler(event:Event):void
Handles events on the grid overflow skin part. | Calendar | ||
gridRendererHandler(event:Event):void
Handles events on the grid renderers skin part. | Calendar | ||
handleRendererSelection(dtStart:Date, dtEnd:Date, schedulingData:SchedulingData, event:MouseEvent):void
Handles selectedData and handles multiple selection if the shift or
control key were held down during selection. | Calendar | ||
initializeColumnMode():void
Initialize the column view containers. | Calendar | ||
initializeGridMode():void
Initialize the grid view containers. | Calendar | ||
refresh():void
Set flag to refresh the item renderers on the next layout pass. | Calendar | ||
removeFromStore(item:SchedulingData):void
Removes a SchedulingData object and any associated StoreData objects
from the local store. | Calendar | ||
removeOverflowPopup():void
Remove the overflowPopup (if exists). | Calendar | ||
returnSortedIndex(item:StoreData):int
Returns what index the StoreData object should be inserted into the
local store to keep the local store sorted. | Calendar | ||
Sorts the local store of StoreData objects. | Calendar | ||
updateCanvas():void
Update the canvas for the current display mode. | Calendar | ||
updateColumnCanvas():void
Update the columnCanvas vector drawing. | Calendar | ||
updateColumnLabels():void
Update the column labels skin part. | Calendar | ||
updateColumnRenderers():void
Update the column renderers skin part. | Calendar | ||
updateDateMap():void
Creates an array of the start date(s) for each day displayed. | Calendar | ||
updateFilteredStore():void
Create a store of the data that will be displayed. | Calendar | ||
updateGridCanvas():void
Update the gridCanvas vector drawing. | Calendar | ||
updateGridLabels():void
Update the grid labels skin part. | Calendar | ||
updateGridRenderers():void
Update the grid renderers skin part. | Calendar | ||
updateRecurrenceSet(end:Date):void
Updates the store by adding in the recurrence set for SchedulingData
objects in the dataProvider. | Calendar | ||
updateRendererSelection(factoryName:String):void
Updates the item renderers based on the selected data. | Calendar | ||
updateSelection():void
Updates the selection on the renderers based on the "selectedData"
property. | Calendar | ||
updateSubColumnLabels():void
Update the sub column labels skin part. | Calendar | ||
updateTimeLabels():void
Update the time labels skin part. | Calendar | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the displayed dates change. | Calendar | |||
| Dispatched when the grid label item renderers are moused down. | Calendar | |||
| Dispatched when an item renderer is clicked. | Calendar | |||
| Dispatched when a drag or resize is finished. | Calendar | |||
| Dispatched before a renderer drag starts. | Calendar | |||
| Dispatched when the selected data changes. | Calendar | |||
| Dispatched when the selected period changes. | Calendar | |||
This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.
To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.
| Skin State | Description | Defined By | ||
|---|---|---|---|---|
disabled | Calendar | |||
normal | Calendar | |||
| allowMultipleSelection | property |
public var allowMultipleSelection:Boolean = trueTrue to enable multiple selection.
The default value is true.
| autoScrollThreshold | property |
public var autoScrollThreshold:Number = 50Defines the threshold from the boundaries of the viewport in which to trigger automatic scrolling during a dragging operation for column display modes.
The default value is 50.
| columnCount | property |
columnCount:intThe number of columns to display. Applicable to all display modes.
The default value is 7.
public function get columnCount():int public function set columnCount(value:int):void| dataProvider | property |
dataProvider:IListThe dataProvider for the chart.
Requires a collection of SchedulingData objects.
This property is bindable. Bound to the "selectedDataChange" event.
The default value is null.
This property can be used as the source for data binding.
public function get dataProvider():IList public function set dataProvider(value:IList):void| displayMode | property |
displayMode:StringThe current display mode.
"column" is the mode by which single days or a week are displayed. "grid" is the typical method by which a month is displayed. "columnAndAllDayGrid" is a combination of both a grid and column based mode, using the column to display non-allday events and the grid mode to display allday events.
The default value is "column".
public function get displayMode():String public function set displayMode(value:String):void| dragEnabled | property |
public var dragEnabled:Boolean = trueEnables or disables item renderer dragging.
The default value is true.
| dragIncrement | property |
public var dragIncrement:Number = 15The number of minutes that renderers will grow/shrink during drag (resize) operations for the column display modes.
The default value is 15.
| endTime | property |
endTime:NumberThe number of minutes to end the calendar display in column based display modes.
The default value is 1080 (6 PM).
public function get endTime():Number public function set endTime(value:Number):void| familyIndexEnd | property |
protected var familyIndexEnd:NumberHolds the last maximum end position value for a family of overlapped renderers for the column mode.
| minMinutesDisplayedInViewport | property |
minMinutesDisplayedInViewport:NumberThe minimum number of minutes of a day that are displayed in the viewport for the column based display modes.
E.G. the number of minutes visible without scrolling.
The default value is 540 (9 hours).
public function get minMinutesDisplayedInViewport():Number public function set minMinutesDisplayedInViewport(value:Number):void| primaryTimeIntervalMinutes | property |
primaryTimeIntervalMinutes:NumberThe number of minutes for each primary time interval for the column display modes.
The default value is 60.
public function get primaryTimeIntervalMinutes():Number public function set primaryTimeIntervalMinutes(value:Number):void| resizeAxis | property |
protected var resizeAxis:DateFor resize dragging, stores the axis (E.G., the start or end depending on the direction of resize) in minutes.
| resizeThreshold | property |
public var resizeThreshold:int = 6The number of pixels from the edges of the renderer in the column display modes that a resize cursor will be displayed and a resize operation will start on mousedown.
The default value is 6.
| rowCount | property |
rowCount:intThe number of rows to display. Only applicable to the grid display mode.
The default value is 4.
public function get rowCount():int public function set rowCount(value:int):void| secondaryTimeIntervalCount | property |
secondaryTimeIntervalCount:NumberThe number of secondary time intervals to draw between primary time intervals for column based display modes.
The default value is 1.
public function get secondaryTimeIntervalCount():Number public function set secondaryTimeIntervalCount(value:Number):void| selectedData | property |
selectedData:Vector.<SelectedCalendarData>The selected calendar data.
A vector of SelectedCalendarData objects.
This property is bindable. Bound to the "selectedDataChange" event.
The default value is null.
This property can be used as the source for data binding.
public function get selectedData():Vector.<SelectedCalendarData> public function set selectedData(value:Vector.<SelectedCalendarData>):void| selectedPeriod | property |
selectedPeriod:CalendarPeriodThe time period selected via user interaction. If sub columns are displayed, the selected period will have a reference to the calendar whose sub column is selected.
This property is bindable. Bound to the "selectedPeriodChange" event.
The default value is null.
This property can be used as the source for data binding.
public function get selectedPeriod():CalendarPeriod public function set selectedPeriod(value:CalendarPeriod):void| showFriday | property |
showFriday:BooleanDisplay data for friday.
The default value is true.
public function get showFriday():Boolean public function set showFriday(value:Boolean):void| showMonday | property |
showMonday:BooleanDisplay data for monday.
The default value is true.
public function get showMonday():Boolean public function set showMonday(value:Boolean):void| showSaturday | property |
showSaturday:BooleanDisplay data for saturday.
The default value is true.
public function get showSaturday():Boolean public function set showSaturday(value:Boolean):void| showSunday | property |
showSunday:BooleanDisplay data for sunday.
The default value is true.
public function get showSunday():Boolean public function set showSunday(value:Boolean):void| showThursday | property |
showThursday:BooleanDisplay data for thursday.
The default value is true.
public function get showThursday():Boolean public function set showThursday(value:Boolean):void| showTuesday | property |
showTuesday:BooleanDisplay data for tuesday.
The default value is true.
public function get showTuesday():Boolean public function set showTuesday(value:Boolean):void| showWednesday | property |
showWednesday:BooleanDisplay data for wednesday.
The default value is true.
public function get showWednesday():Boolean public function set showWednesday(value:Boolean):void| startDate | property |
startDate:DateThe start date to begin display in the calendar. Any time on the provided Date object will be scrubbed and only the date will be used.
This property is bindable and bound to the "displayedDatesChanged" property.
The default value is today's date.
This property can be used as the source for data binding.
public function get startDate():Date public function set startDate(value:Date):void| startTime | property |
startTime:NumberThe number of minutes to start the calendar display in column based display modes.
The default value is 480 (6 AM).
public function get startTime():Number public function set startTime(value:Number):void| subColumn | property |
protected var subColumn:intHold the contextual sub column.
| subColumnsCalendars | property |
subColumnsCalendars:ICollectionViewSupply an ICollectionView of CalendarDefinitionData objects to display each calendar in a sub column within a column for the column modes.
The default value is null.
public function get subColumnsCalendars():ICollectionView public function set subColumnsCalendars(value:ICollectionView):void| addToStore | () | method |
protected function addToStore(item:SchedulingData, sort:Boolean = true):voidAdds a SchedulingData object to the local store by creating the necessary StoreData objects and adding them to the store at the sorted index.
You can skip adding the new objects to their sorted index position for increased speed.
Parameters
item:SchedulingData — The SchedulingData object to add to the store
| |
sort:Boolean (default = true) — TRUE to add the object in the sorted position
|
| canvasHandler | () | method |
protected function canvasHandler(event:Event):voidHandles events on the canvas used for selected time period dragging for all display modes.
Parameters
event:Event — the Event that triggered the handler
|
| checkForAutoScroll | () | method |
protected function checkForAutoScroll():voidChecks if the mouse is within the autoscroll threshold during drag operations.
Only applicable to the "column" display mode.
| clearAutoScroll | () | method |
protected function clearAutoScroll():voidClears the auto scrolling timer.
| columnRendererHandler | () | method |
protected function columnRendererHandler(event:Event):voidHandles events on the column renderer skin part.
Parameters
event:Event — the Event that triggered the handler
|
| dragHandler | () | method |
protected function dragHandler(event:Event):voidHandles item renderer dragging and resizing.
Parameters
event:Event — the Event that triggered the handler
|
| eventHandler | () | method |
protected function eventHandler(event:Event):voidHandles events on the component.
Parameters
event:Event — the Event that triggered the handler
|
| getColumnStartPositions | () | method |
protected function getColumnStartPositions(rendererIndex:int, dayStore:Vector.<StoreData>):voidSets the layout positions on the store data for the column renderers.
Parameters
rendererIndex:int — index of the data in the collection.
| |
dayStore:Vector.<StoreData> — a store of StoreData for a particular day
|
| getDateMap | () | method |
public function getDateMap():ArrayReturn the protected dateMap array.
ReturnsArray — array
|
| getFirstEmptyIndex | () | method |
protected function getFirstEmptyIndex(arr:Array):intReturns the first empty index value in the provided array. Used to locate a renderer's vertical index for the grid display mode.
Parameters
arr:Array — The array to find the first empty index.
|
int — int the index of the empty position in the array.
|
| getMousedGridIndex | () | method |
protected function getMousedGridIndex(canvas:SpriteVisualElement):intReturns the row/column of where the mouse is located.
Parameters
canvas:SpriteVisualElement |
int — the int index
|
| getStoreData | () | method |
public function getStoreData(start:Date, end:Date, searchPhrase:String = null):ArrayReturns an array of store data based on the input parameters. Will return data for repeating scheduled data.
Added optional searchPhrase property that will only return objects that have the string in their string properties.
Useful for list components.
Parameters
start:Date — The start Date to filter from
| |
end:Date — The end Date to filter from
| |
searchPhrase:String (default = null) — a string used to filter objects
|
Array — an Array of StoreData objects
|
| gridLabelHandler | () | method |
protected function gridLabelHandler(event:Event):voidHandles events on the grid label skin part.
Parameters
event:Event — the Event that triggered the handler
|
| gridOverflowHandler | () | method |
protected function gridOverflowHandler(event:Event):voidHandles events on the grid overflow skin part.
Parameters
event:Event — the Event that triggered the handler
|
| gridRendererHandler | () | method |
protected function gridRendererHandler(event:Event):voidHandles events on the grid renderers skin part.
Parameters
event:Event — the Event that triggered the handler
|
| handleRendererSelection | () | method |
protected function handleRendererSelection(dtStart:Date, dtEnd:Date, schedulingData:SchedulingData, event:MouseEvent):voidHandles selectedData and handles multiple selection if the shift or control key were held down during selection.
Note: for multiple selections, the logic follows the windows OS. A context object is maintained, which is set to the last selected renderer, or the last selection when the ctrl key was down. Shift selections do not change the context object.
Parameters
dtStart:Date — the start Date for the renderer
| |
dtEnd:Date — the end Date for the renderer
| |
schedulingData:SchedulingData — the SchedulingData for the renderer
| |
event:MouseEvent — the MouseEvent that triggered the function
|
| initializeColumnMode | () | method |
protected function initializeColumnMode():voidInitialize the column view containers.
| initializeGridMode | () | method |
protected function initializeGridMode():voidInitialize the grid view containers.
| invalidateRenderersDisplayList | () | method |
public function invalidateRenderersDisplayList():voidConvenient method to invalidate the display list for the item renderers.
Handy when unbound properties are changed and the renderers need to be updated. Could also manually loop through the dynamic item renderer parts and invalidate the layout.
| refresh | () | method |
protected function refresh():voidSet flag to refresh the item renderers on the next layout pass.
| removeFromStore | () | method |
protected function removeFromStore(item:SchedulingData):voidRemoves a SchedulingData object and any associated StoreData objects from the local store.
Parameters
item:SchedulingData — The SchedulingData object to remove
|
| removeOverflowPopup | () | method |
protected function removeOverflowPopup():voidRemove the overflowPopup (if exists).
| returnSortedIndex | () | method |
protected function returnSortedIndex(item:StoreData):intReturns what index the StoreData object should be inserted into the local store to keep the local store sorted.
Parameters
item:StoreData — The object to have its sorted index determined
|
int — The index of the sorted position
|
| scrollToTime | () | method |
public function scrollToTime(minutes:Number):voidScroll to the passed time for a column based display mode.
Parameters
minutes:Number — the minutes to scroll to (if possible)
|
| sortStore | () | method |
protected function sortStore(x:StoreData, y:StoreData):NumberSorts the local store of StoreData objects.
Parameters
x:StoreData — The first StoreData object.
| |
y:StoreData — The second StoreData object.
|
Number — The number 1 if x should be sorted earlier than y, -1 if x
should be sorted later than y.
|
| updateCanvas | () | method |
protected function updateCanvas():voidUpdate the canvas for the current display mode. Handles the vector drawing. E.G. the grid lines, selected period, today's date, etc.
| updateColumnCanvas | () | method |
protected function updateColumnCanvas():voidUpdate the columnCanvas vector drawing.
| updateColumnLabels | () | method |
protected function updateColumnLabels():voidUpdate the column labels skin part.
| updateColumnRenderers | () | method |
protected function updateColumnRenderers():voidUpdate the column renderers skin part.
| updateDateMap | () | method |
protected function updateDateMap():voidCreates an array of the start date(s) for each day displayed. Accounts for hidden days.
| updateFilteredStore | () | method |
protected function updateFilteredStore():voidCreate a store of the data that will be displayed. Used by the item renderers.
| updateGridCanvas | () | method |
protected function updateGridCanvas():voidUpdate the gridCanvas vector drawing.
| updateGridLabels | () | method |
protected function updateGridLabels():voidUpdate the grid labels skin part.
| updateGridRenderers | () | method |
protected function updateGridRenderers():voidUpdate the grid renderers skin part.
| updateRecurrenceSet | () | method |
protected function updateRecurrenceSet(end:Date):voidUpdates the store by adding in the recurrence set for SchedulingData objects in the dataProvider. Will create the recurrence set up to the end Date object provided.
Parameters
end:Date — The Date the recurrence set will created up to
|
| updateRendererSelection | () | method |
protected function updateRendererSelection(factoryName:String):voidUpdates the item renderers based on the selected data.
Parameters
factoryName:String — the name of the factory for the renderers to update
|
| updateSelection | () | method |
protected function updateSelection():voidUpdates the selection on the renderers based on the "selectedData" property.
| updateSubColumnLabels | () | method |
protected function updateSubColumnLabels():voidUpdate the sub column labels skin part.
| updateTimeLabels | () | method |
protected function updateTimeLabels():voidUpdate the time labels skin part.
| displayedDatesChanged | Event |
ardisia.scheduling.calendar.events.CalendarEventardisia.scheduling.calendar.events.CalendarEventDispatched when the displayed dates change.
| gridLabelMouseDown | Event |
ardisia.scheduling.calendar.events.CalendarEventardisia.scheduling.calendar.events.CalendarEventDispatched when the grid label item renderers are moused down. Typically used to zoom in on particular days on the month.
| itemClick | Event |
ardisia.scheduling.calendar.events.CalendarEventardisia.scheduling.calendar.events.CalendarEventDispatched when an item renderer is clicked.
| itemDragEnd | Event |
ardisia.scheduling.calendar.events.CalendarEventardisia.scheduling.calendar.events.CalendarEventDispatched when a drag or resize is finished.
NOTE: the SchedulingData represented by the dragged renderer will be updated and the collection (dataProvider) will dispatch an "UPDATE" event. Listen for it to update your data source. If the dragged item comes from a repeating series, then the dragged item will be excluded from the series.
| itemDragStarting | Event |
ardisia.scheduling.calendar.events.CalendarEventardisia.scheduling.calendar.events.CalendarEventDispatched before a renderer drag starts. Can be cancelled.
| selectedDataChange | Event |
ardisia.scheduling.calendar.events.CalendarEventardisia.scheduling.calendar.events.CalendarEventDispatched when the selected data changes. See the "selectedData" property.
| selectedPeriodChange | Event |
ardisia.scheduling.calendar.events.CalendarEventardisia.scheduling.calendar.events.CalendarEventDispatched when the selected period changes.