Premium support for our pure JavaScript UI components


Post by vincenzo.menzella »

Hi everyone,

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!

Thanks in advance for your help!


Post by mats »

Have you seen our nested events demos? Like this one? https://bryntum.com/products/schedulerpro/examples/nested-events-deep/

Is it something like this you're envisioning?


Post by vincenzo.menzella »

Thanks for sharing the demo, i’ve already taken a look. However, after reading the documentation https://bryntum.com/products/schedulerpro/docs/api/SchedulerPro/feature/NestedEvents#property-maxNesting, I noticed it explicitly states that a nesting depth greater than 2 is not recommended. Since I need to support hierarchies of more than 2 levels, I’m not sure this approach would work for my use case.


Post by alex.l »

Hi,

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/

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy

We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services


Post by vincenzo.menzella »

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.

Thanks for any pointers!


Post by marcio »

Hey Vincenzo,

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.

Documentation reference: https://bryntum.com/products/schedulerpro/docs/api/SchedulerPro/data/EventStore#event-update

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post by vincenzo.menzella »

Thanks a lot! Using the event you mentioned, the workaround works as expected. I really appreciate the help!


Post Reply