Our state of the art Gantt chart


Post by loaiz »

Hi everyone,

I'm using Bryntum Gantt inside a Next.js API route to process and return scheduled data. Here's how I set up the scheduling:

const project = new ProjectModel({
    tasksData: tasks,
    dependenciesData: relations,
});

await project.commitAsync();

const scheduledTasks = project.taskStore.toJSON();
const scheduledDependencies = project.dependencyStore.toJSON();

res.status(200).json({ tasksData: scheduledTasks, dependenciesData: scheduledDependencies });

This works fine and returns the fully scheduled tasks and dependencies.

Problem: How to Get Only the Affected (Changed) Tasks?

I need to track only the tasks or dependencies that were changed by the scheduling engine. Here’s what I have tried:

  • Checking project.changes → Always returns null.

  • Using the change event listener → It fires, but I get all tasks, not just the ones that changed.

  • Using onChange on ProjectModel → Same issue; it returns everything instead of just the affected records.


What I Need:

  • I’m looking for a reliable way to get only the affected (modified) tasks after scheduling.
  • How can I efficiently detect tasks whose start or end date changed after scheduling?
  • Is there a built-in method to compare the original data vs. the scheduled data without manually iterating?

Any guidance would be greatly appreciated! Thanks in advance.


Post by marcio »

Hey loaiz,

Thanks for reaching out.

Is there any chance to provide a test case? By your description, project.changes is what you're looking for, but you said that's empty for you, and you do await project.commitAsync(); which should make sure that all calculations are complete and changes are up to date.

If project.changes is returning null, verify that changes have indeed been made and committed. If the issue persists, please provide more details about your setup.

Which version are you using?

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post by loaiz »

Hi Marcio,

I've sent you a private message with the demo.

Looking forward to your feedback.

Best regards,
Loai


Post by marcio »

Hey Loai,

I see that you're looking for changes right after you load the data into the ProjectModel, so it's expected that the changes are empty at that moment.

If I understood, you have a data set that is not scheduled, and you want to check the differences between them right after our Engine schedules them automatically, is that correct?

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post by loaiz »

Yes that is correct


Post by tasnim »

Hi,

Sorry for late reply.

you have a data set that is not scheduled, and you want to check the differences between them right after our Engine schedules them automatically, is that correct?

For that, you'd need to set https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#config-silenceInitialCommit to false and after the first load of Gantt you can check the changes through https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#property-changes property. And you should see the tasks affected by the scheduling engine.

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post Reply