ResourceHeader
Header widget that renders resource column headers and acts as the interaction point for resource columns in vertical mode. Note that it uses virtual rendering and element reusage to gain performance, only headers in view are available in DOM. Because of this you should avoid direct element manipulation, any such changes can be discarded at any time.
By default, it displays resources name and also applies its iconCls if any, like this:
<i class="iconCls">name</i>
If Scheduler is configured with a resourceImagePath the header will render miniatures for the resources, using imageUrl or image with fallback to name + resourceImageExtension for unset values.
The contents and styling of the resource cells in the header can be customized using headerRenderer:
new Scheduler({
mode : 'vertical',
resourceColumns : {
headerRenderer : ({ resourceRecord }) => `Hello ${resourceRecord.name}`
}
}
The width of the resource columns is determined by the columnWidth config.
Useful configs and functions
| Member | Description |
|---|---|
| headerRenderer | Custom header renderer function |
| showAvatars | Show resource images in the header |
| fillWidth | Auto-resize columns to fill available width |
| fitWidth | Auto-resize columns to fit all resources |
| columnWidth | Width for each resource column |
See also
- ResourceModel - Resource data model
- ResourceColumnReorder - Reorder resource columns
- ResourceMenu - Resource context menu
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Resource store used to render resource headers. Assigned from Scheduler.
-
Set to
falseto render just the resource name,trueto render an avatar (or initials if no image exists)
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ResourceHeader class, or subclass thereof.
-
An index of the first visible resource in vertical mode
-
An index of the last visible resource in vertical mode
-
Identifies an object as an instance of ResourceHeader class, or subclass thereof.
Functions
Functions are methods available for calling on the class-
refresh( )
Refreshes the visible headers
CSS variables
CSS variables that can be set to adjust appearance| Name | Description |
|---|---|
| --b-resource-header-avatar-background-color | Resource header avatar background color (vertical mode) |
| --b-resource-header-avatar-size | Resource header avatar size (vertical mode) |
| --b-resource-header-gap | Resource header inner gap (vertical mode) |