ViewPresetHeaderRow
A part of the ViewPreset declaration. Not used directly, but the properties below are instead provided inline as seen in sources of PresetManager. This class is just provided for documentation purposes.
A sample header configuration can look like below
headers : {
{
unit : "month",
renderer : function(start, end, headerConfig, index) {
var month = start.getMonth();
// Simple alternating month in bold
if (start.getMonth() % 2) {
return '<strong>' + month + '</strong>';
}
return month;
},
align : 'start' // `start` or `end`, omit to center content (default)
},
{
unit : "week",
increment : 1,
renderer : function(start, end, headerConfig, index) {
return 'foo';
}
},
}
Useful configs and functions
| Member | Description |
|---|---|
| unit | Time unit for the header row |
| increment | Increment of the time unit |
| dateFormat | Date format string for cell content |
| renderer | Custom cell renderer function |
| align | Text alignment in header cells |
See also
- ViewPreset - View preset configuration
- PresetManager - Built-in presets
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
The text alignment for the cell. Valid values are
startorend, omit this to center text content (default). Can also be added programmatically in the renderer -
Defines how the cell date will be formatted
-
A CSS class to add to the cells in the time axis header row. Can also be added programmatically in the renderer
-
The number of units each header cell will represent (e.g. 30 together with unit: "minute" for 30 minute cells)
-
thisreference for the renderer function -
The unit of time represented by each cell in this header row. See also increment property. Valid values are "millisecond", "second", "minute", "hour", "day", "week", "month", "quarter", "year".