TreeSummary

A feature allowing you to roll up and display values in the time axis cell for each parent row in a tree scheduler.

This feature is disabled by default.

const scheduler = new Scheduler({
     appendTo : 'container',
     features : {
         treeSummary : {
             renderer({ startDate, endDate, resourceRecord, timeline }) {
                 let totalDemandedCapacity = 0;

                 resourceRecord.traverse(child => {
                     child.events.forEach(task => {
                         if (DateHelper.intersectSpans(task.startDate, task.endDate, startDate, endDate)) {
                             totalDemandedCapacity += task.demandedCapacity || 0;
                         }
                     });
                 }, true);

                 if (timeline.project.effectiveCalendar.isWorkingTime(startDate, endDate)) {
                     return 1 - totalDemandedCapacity;
                 }

                 return 0;
             }
         }
     }
});

Configs

11

Common

disabledInstancePlugin
listenersEvents

Other

Set to false to disallow mouse interactions with the rendered range elements. By default, the range elements are reachable with the mouse.

renderer: function

Required, renderer function for parent resource summary cells. Used to both calculate and format the summary. Should return textual content or a DomConfig object.

new Scheduler({
    features : {
        treeSummary : {
            renderer({ startDate, endDate, resourceRecord, timeline }) {
                 let totalDemandedCapacity = 0;

                 resourceRecord.traverse(node => {
                    node.events.forEach(task => {
                         if (DateHelper.intersectSpans(task.startDate, task.endDate, startDate, endDate)) {
                             totalDemandedCapacity += task.demandedCapacity || 0;
                         }
                     });
                 }, true);

                 if (timeline.project.effectiveCalendar.isWorkingTime(startDate, endDate)) {
                     return 1 - totalDemandedCapacity;
                 }

                 return 0;
            }
        }
    }
});
ParameterTypeDescription
contextObject

Summary context object

context.startDateDate

Tick start date

context.endDateDate

Tick end date

context.resourceRecordResourceModel

Resource record representing the current row

context.eventStoreEventStore

Event store

context.resourceStoreResourceStore

Resource store

context.timelineTimelineBase

The timeline/scheduler instance

Returns: String | DomConfig -

Either textual content or a DomConfig object

Misc

clientInstancePlugin
localeClassLocalizable
localizableLocalizable

Properties

16

Common

disabledInstancePlugin

Class hierarchy

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

Other

Set to false to disallow mouse interactions with the rendered range elements. By default, the range elements are reachable with the mouse.

Lifecycle

configBase

Misc

clientInstancePlugin
localeHelperLocalizable
localeManagerLocalizable

Functions

28

Configuration

applyDefaultsstaticBase

Events

Lifecycle

destroystaticBase

Misc

doDisableInstancePlugin
initClassstaticBase
isOfTypeNamestaticBase
mixinstaticBase
optionalLstaticLocalizable

Other

LstaticLocalizable
onEvents
relayAllEvents
triggerEvents
unEvents

Events

10

Triggered for click on a tick cell. Only triggered if the TreeSummary feature is configured with enableMouseEvents: true.

// Adding a listener using the "on" method
treeSummary.on('tickCellClick', ({ source, feature, startDate, endDate, resourceRecord, domEvent }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

Triggered for right-click on a tick cell. Only triggered if the TreeSummary feature is configured with enableMouseEvents: true.

// Adding a listener using the "on" method
treeSummary.on('tickCellContextMenu', ({ source, feature, startDate, endDate, resourceRecord, domEvent }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

Triggered for double-click on a tick cell. Only triggered if the TreeSummary feature is configured with enableMouseEvents: true.

// Adding a listener using the "on" method
treeSummary.on('tickCellDblClick', ({ source, feature, startDate, endDate, resourceRecord, domEvent }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

Triggered for mouse down on a tick cell. Only triggered if the TreeSummary feature is configured with enableMouseEvents: true.

// Adding a listener using the "on" method
treeSummary.on('tickCellMouseDown', ({ source, feature, startDate, endDate, resourceRecord, domEvent }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

Triggered for mouse up on a tick cell. Only triggered if the TreeSummary feature is configured with enableMouseEvents: true.

// Adding a listener using the "on" method
treeSummary.on('tickCellMouseUp', ({ source, feature, startDate, endDate, resourceRecord, domEvent }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

catchAllEvents
destroyEvents
disableInstancePlugin
enableInstancePlugin

Event handlers

10

Called for click on a tick cell. Only called if the TreeSummary feature is configured with enableMouseEvents: true.

new TreeSummary({
    onTickCellClick({ source, feature, startDate, endDate, resourceRecord, domEvent }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

Called for right-click on a tick cell. Only called if the TreeSummary feature is configured with enableMouseEvents: true.

new TreeSummary({
    onTickCellContextMenu({ source, feature, startDate, endDate, resourceRecord, domEvent }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

Called for double-click on a tick cell. Only called if the TreeSummary feature is configured with enableMouseEvents: true.

new TreeSummary({
    onTickCellDblClick({ source, feature, startDate, endDate, resourceRecord, domEvent }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

Called for mouse down on a tick cell. Only called if the TreeSummary feature is configured with enableMouseEvents: true.

new TreeSummary({
    onTickCellMouseDown({ source, feature, startDate, endDate, resourceRecord, domEvent }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

Called for mouse up on a tick cell. Only called if the TreeSummary feature is configured with enableMouseEvents: true.

new TreeSummary({
    onTickCellMouseUp({ source, feature, startDate, endDate, resourceRecord, domEvent }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler

featureTreeSummary

The TreeSummary feature

startDateDate

Tick start date

endDateDate

Tick end date

resourceRecordResourceModel

Resource record

domEventMouseEvent

Browser event

onDestroyEvents
onDisableInstancePlugin
onEnableInstancePlugin

Typedefs

1