ResourceView
A Calendar view which encapsulates a series of child Calendar views, one for each resource (often referred to as "calendar") in the project.
The type of view displayed defaults to 'week', but this can be changed using the type property in the view config object.
Usage :
new Calendar({
appendTo : domElement,
// Resource avatar images are loaded from this path
resourceImagePath : '../_shared/images/users/',
modes : {
// Let's not show the default views
day : null,
week : null,
month : null,
year : null,
agenda : null,
// Mode name can be anything if it contains a "type" property.
monthResourceview : {
// Type has the final say over which view type is created
type : 'resource',
// This is a config object for the subviews; one for each resource
view : {
// We show a month view for each resource in the project
type : 'month'
}
}
}
});
Useful configs
| Config | Description |
|---|---|
| view | Config for child views (type, range, etc.) |
| resourceWidth | Width of each resource panel |
| showAvatars | Show resource avatar images in headers |
| meta | Field or function for subheader text |
| hideEmptyResources | Hide resource panels with no events |
See also
- Calendar — The main Calendar that hosts this view
- DayResourceView — Alternative resource layout grouping resources by date
- WeekView — The default child view type used per resource
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Configure this as
trueto hide child views which have no events.Has a corresponding runtime hideEmptyResources property.
-
Set to
trueto hide non-working daysHas a corresponding runtime hideNonWorkingDays property.
-
If the displayed view is a DateRangeOwner, this may be used to set the range of all child views.
Has a corresponding runtime range property.
-
The width of a resource calendar panel (view always stretches to fill window)
Has a corresponding runtime resourceWidth property.
-
The space to leave between each subview.
Has a corresponding runtime viewGap property.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ResourceView class, or subclass thereof.
-
This creates a specially styled
DayViewwhich matches the view config (so thatdayStartTime,hourHeightetc. is synced) which shows nothing but its scrollbar. This acts as the single visible scrollbar on the right of theResourceView. We cannot have the lastDayViewoverflowY : truebecause then its flexed width being equal to the others, its content area would bescrollBarWidthnarrower than the others. -
This creates a specially styled DayView which matches the view config (so that dayStartTime, hourHeight etc. is synced) which shows nothing but its time axis. This acts as the single visible time axis on the left.
-
Returns the value of the child view's fixedDuration property.
-
Configure this as
trueto hide child views which have no events.Has a corresponding hideEmptyResources config.
-
Set to
trueto hide non-working daysHas a corresponding hideNonWorkingDays config.
-
If the displayed view is a DateRangeOwner, this may be used to set the range of all child views.
Has a corresponding range config.
-
The width of a resource calendar panel (view always stretches to fill window)
Has a corresponding resourceWidth config.
-
The space to leave between each subview.
Has a corresponding viewGap config.
-
Yields the views which this ResourceView owns.
-
Identifies an object as an instance of ResourceView class, or subclass thereof.