Summary

A special version of the Grid Summary feature. This feature displays a summary row in the grid footer.

Summary
//<code-header>
fiddle.title = 'Summary';
//</code-header>
targetElement.innerHTML = '<p>A demo with column and event summary:</p>';
const scheduler = new Scheduler({
    appendTo : targetElement,

    // makes scheduler as high as it needs to be to fit rows
    autoHeight : true,

    features : {
        summary : {
            renderer : ({ events }) => events.length || ''
        }
    },

    startDate : new Date(2018, 4, 6),
    endDate   : new Date(2018, 4, 13),

    columns : [
        { field : 'name', text : 'Name', width : 100 },
        { field : 'rank', text : 'Rank', width : 100, sum : 'average', summaryRenderer : ({ sum }) => `Average: ${sum}` }
    ],

    resources : [
        { id : 1, name : 'Bernard', rank : 5 },
        { id : 2, name : 'Bianca', rank : 4 },
        { id : 3, name : 'Belinda', rank : 3 }
    ],

    events : [
        { id : 1, resourceId : 1, name : 'Drag around', startDate : '2018-05-07', endDate : '2018-05-10' },
        { id : 2, resourceId : 2, name : 'to update', startDate : '2018-05-08', endDate : '2018-05-12' },
        { id : 3, resourceId : 2, name : 'summaries', startDate : '2018-05-09', endDate : '2018-05-10' },
        { id : 4, resourceId : 3, name : 'below', startDate : '2018-05-09', endDate : '2018-05-10' }
    ]
});

For regular columns in the locked section - specify type of summary on columns, available types are:

Type Description
sum Sum of all values in the column
add Alias for sum
count Number of rows
countNotEmpty Number of rows containing a value
average Average of all values in the column
function A custom function, used with store.reduce. Should take arguments (sum, record)

Columns can also specify a summaryRender to format the calculated sum.

To summarize events, either provide a renderer or use summaries

This feature is disabled by default.

Configs

15

Common

disabledInstancePlugin
listenersEvents

Other

renderer: function

Renderer function for a single time axis tick. Should calculate a sum and return HTML as a result.

You should never modify any records inside this method.
new Scheduler({
    features : {
        summary : {
            renderer : ({ startDate, endDate, eventStore, resourceStore, events, element }) => {
                // return display value
                returns '<div>Renderer output</div>';
            }
        }
    }
});
ParameterTypeDescription
contextObject

Rendering context object

context.startDateDate

Tick start date

context.endDateDate

Tick end date

context.eventsEventModel[]

Events which belong to the group

context.eventStoreEventStore

Event store

context.resourceStoreResourceStore

Resource store

context.elementHTMLElement

Summary tick container

Returns: String -

Html content

Array of summary configs which consists of a label and a renderer function

new Scheduler({
    features : {
        summary : {
            summaries : [
                {
                    label : 'Label',
                    renderer : ({ startDate, endDate, eventStore, resourceStore, events, element }) => {
                        // return display value
                        returns '<div>Renderer output</div>';
                    }
                }
            ]
        }
    }
});

A config object for the Column used to contain the summary bar.

showTooltipTimelineSummary

Misc

clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Properties

18

Common

disabledInstancePlugin

Class hierarchy

isSummary: Boolean= truereadonly
Identifies an object as an instance of Summary class, or subclass thereof.
isSummary: Boolean= truereadonlystatic
Identifies an object as an instance of Summary class, or subclass thereof.
isEventsEvents
isInstancePluginInstancePlugin
isLocalizableLocalizable
isTimelineSummaryTimelineSummary

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable

Other

Functions

29

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

LstaticLocalizable
onEvents
refreshTimelineSummary
relayAllEvents
triggerEvents
unEvents

Events

5
catchAllEvents
destroyEvents
disableInstancePlugin
enableInstancePlugin

Event handlers

5
onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin

Typedefs

3

Defines a summary, used by the Summary and GroupSummary features.

ParameterTypeDescription
labelString

Label for the summary

rendererfunction

Function to calculate and render the summary value

renderer.startDateDate
renderer.endDateDate
renderer.eventStoreEventStore
renderer.resourceStoreResourceStore
eventsEventModel[]
resourcesResourceModel[]
groupRecordModel
groupFieldString
groupValueObject

CSS variables

1

Inherited