GroupSummary
A special version of the Grid GroupSummary feature that enables summaries within scheduler. To use a single summary it is easiest to configure renderer, for multiple summaries see summaries.
This feature is disabled by default. It is not supported in vertical mode.
//<code-header>
fiddle.title = 'Group summary';
//</code-header>
const scheduler = new Scheduler({
appendTo : targetElement,
// makes scheduler as high as it needs to be to fit rows
autoHeight : true,
features : {
group : 'company',
groupSummary : {
renderer : ({ events }) => events.length
}
},
startDate : new Date(2018, 4, 6),
endDate : new Date(2018, 4, 13),
columns : [
{ field : 'name', text : 'Name', width : 150 }
],
resources : [
{ id : 1, name : 'Bernard', company : 'Company A' },
{ id : 2, name : 'Bianca', company : 'Company A' },
{ id : 3, name : 'Belinda', company : 'Company B' }
],
events : [
{ id : 1, resourceId : 1, name : 'First', startDate : '2018-05-07', endDate : '2018-05-10' },
{ id : 2, resourceId : 2, name : 'Second', startDate : '2018-05-08', endDate : '2018-05-12' },
{ id : 3, resourceId : 2, name : 'Third', startDate : '2018-05-09', endDate : '2018-05-10' },
{ id : 4, resourceId : 3, name : 'Fourth', startDate : '2018-05-09', endDate : '2018-05-10' }
]
});Configs
15
Configs
15Other
Renderer function for a single time axis tick in a group summary row. Should calculate a sum and return HTML as a result.
new Scheduler({
features : {
groupSummary : {
renderer : ({ startDate, endDate, eventStore, resourceStore, events, resources, groupRecord, groupField, groupValue }) => {
// return display value
returns '<div>Renderer output</div>';
}
}
}
});
| Parameter | Type | Description |
|---|---|---|
context | Object | Rendering context object |
context.startDate | Date | Tick start date |
context.endDate | Date | Tick end date |
context.events | EventModel[] | Events which belong to the group |
context.resources | ResourceModel[] | Resources which belong to the group |
context.eventStore | EventStore | Event store |
context.resourceStore | ResourceStore | Resource store |
context.groupRecord | Model | Current groups header row record |
context.groupField | String | Current groups field name |
context.groupValue | String | Current groups value |
Html content
Show tooltip containing summary values and labels
Array of summary configs which consists of a label and a renderer function
summaries : [
{
label : 'Label',
renderer : ({ startDate, endDate, eventStore, resourceStore, events, resources, groupRecord, groupField, groupValue }) => {
// return display value
returns '<div>Renderer output</div>';
}
}
]
Renderer function for the grouping summary tooltip.
new Scheduler({
features : {
groupSummary : {
tooltipTemplate : ({ groupSummaryValues, startDate, endDate, eventStore, resourceStore, events, resources, groupRecord, groupField, groupValue }) => {
return '<div>My custom tooltip html</div>';
}
}
}
});
| Parameter | Type | Description |
|---|---|---|
groupSummaryValues | GroupSummaryValue[] | An array of object with label and value for each summary under the tooltip |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
events | EventModel[] | Events which belong to the group |
resources | ResourceModel[] | Resources which belong to the group |
eventStore | EventStore | Event store |
resourceStore | ResourceStore | Resource store |
groupRecord | Model | Current group's header row record |
groupField | String | Current group's field name |
groupValue | String | Current group's value |
Html content
Misc
Properties
18
Properties
18Common
Class hierarchy
Other
Array of summary configs which consists of a label and a renderer function
summaries : [
{
label : 'Label',
renderer : ({ startDate, endDate, eventStore, resourceStore, events, resources, groupRecord, groupField, groupValue }) => {
// return display value
returns '<div>Renderer output</div>';
}
}
]
Functions
29
Functions
29Configuration
Events
Misc
Other
Events
5
Events
5Event handlers
5
Event handlers
5Typedefs
2
Typedefs
2Represents a group summary value and label
| Parameter | Type | Description |
|---|---|---|
label | String | The label config from a summary cell |
value | * | The value returned from the summary cell renderer. |