I’m working with SchedulerPro and I need to manage events that have child events.
My goal is that whenever a child event is modified, all of its parent events are automatically updated in cascade, just like the behavior you get in the Gantt chart.
Specifically:
I have a hierarchy of events (parents with nested children ).
The hierarchy can be deep (5 levels or more).
When a child’s start date, duration, or any other property changes, the parent event(s) should recalculate their own dates/properties accordingly.
Has anyone implemented this pattern in SchedulerPro?
Any guidance or code examples would be greatly appreciated!
it won't be working out of the box, you're right. It is not supported now. If you need this feature, you could request Sponsored Feature or Professional Services using "Contact us" button here https://bryntum.com/services/
I’ve been thinking of a potential workaround: load all events into SchedulerPro as “leaf” records, adding a custom parentEventId field to track each event’s parent. Then, whenever an event’s dates or duration change, I’d look up its parentEventId and manually walk back up the chain updating each parent in turn.
My question is: what’s the best way to intercept every time an event’s start/end/duration is modified? I need to catch:
Direct edits (e.g. dragging, resizing, editing in the event editor).
Indirect changes that happen because a dependency fired.
You can listen to the update event on the EventStore. This event will trigger whenever an event is modified, whether directly through user interaction or indirectly through dependencies.
Here's a basic example of how you might set this up:
schedulerPro.eventStore.on('update', ({ record, changes }) => {
if (changes.startDate || changes.endDate || changes.duration) {
// Handle the update logic here
// Use record.parentEventId to find and update parent events
}
});
This will allow you to catch changes and implement your logic to update parent events accordingly. Make sure to handle the logic for traversing up the hierarchy and updating parent events based on your custom parentEventId field.