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
Configs
11Other
Set to false to disallow mouse interactions with the rendered range elements. By default, the range elements
are reachable with the mouse.
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;
}
}
}
});
| Parameter | Type | Description |
|---|---|---|
context | Object | Summary context object |
context.startDate | Date | Tick start date |
context.endDate | Date | Tick end date |
context.resourceRecord | ResourceModel | Resource record representing the current row |
context.eventStore | EventStore | Event store |
context.resourceStore | ResourceStore | Resource store |
context.timeline | TimelineBase | The timeline/scheduler instance |
Either textual content or a DomConfig object
Misc
Properties
16
Properties
16Common
Class hierarchy
Other
Set to false to disallow mouse interactions with the rendered range elements. By default, the range elements
are reachable with the mouse.
Functions
28
Functions
28Configuration
Events
Misc
Other
Events
10
Events
10Triggered 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | Browser event |
Event handlers
10
Event handlers
10Called 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler |
feature | TreeSummary | The TreeSummary feature |
startDate | Date | Tick start date |
endDate | Date | Tick end date |
resourceRecord | ResourceModel | Resource record |
domEvent | MouseEvent | Browser event |