Premium support for our pure JavaScript UI components


Post by belms »

Hi Team,

We have overridden Bryntum TaskDrag to be able to support a case where successor can be dragged to a start date before the predecessors end date
We have done the following-

  • set the dependencies to inactive
  • calculate startdate and end date and set the lag
  • set the dependencies back to active
   taskRecord.incomingDeps.forEach((dep) => {
        dep.active = false;
      });

const
        newStartDate = taskRecord.run('calculateStartDate'),
        newEndDate   = taskRecord.run('calculateEndDate');
        
        //calculate lag and set it
 taskRecord.incomingDeps.forEach((dep) => {
		dep.setLag(-1);
});

   taskRecord?.incomingDeps.forEach((dep) => {
        dep.active = true;
      });

This along with the allowNonWorkingTimeSNET flag will allow me to have a successor with start date earlier than predecessors end date.

now when i undo this action the depndency start date,end date gets undone but the dependency becomes inact9ve

This used to work prior to our revision adoption but now once the checkout to a previous revision happens dependency active state is not set properly

What is the correct way of doing this? should we not be setting active state of dependency to false?

To recreate-
Paste the content of the attached file to the editor in https://bryntum.com/products/gantt/examples/realtime-updates/

Also attached is a video of recreation

Attachments
Screen Recording 2025-04-09 at 3.51.18 PM.mov
(5.92 MiB) Downloaded 14 times
Revision_ex.txt
(35.05 KiB) Downloaded 18 times

Post by tasnim »

Thanks for your report. We'll investigate it. Here is the ticket to track progress https://github.com/bryntum/support/issues/11091

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post by belms »

Hi tasnim,

Thank you for the response.

Is there any work around for this? Temporarily can we do something until this is officially released?


Post by tasnim »

Hi,

To temporarily work around the issue, you might consider manually resetting the dependency's active state after an undo operation. You can listen for the undo event and then iterate over the dependencies to set their active state back to true. Here's a basic example:

STM events docs https://bryntum.com/products/gantt/docs/api/Core/data/stm/StateTrackingManager#events

ganttInstance.project.stm.on('restoringStart', () => {
    ganttInstance.taskStore.forEach(task => {
        task.incomingDeps.forEach(dep => {
            dep.active = true;
        });
    });
});

This code assumes you have access to the ganttInstance and that the undo event is properly fired. Adjust the logic as needed based on your specific setup.

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post by belms »

Hi Tasnim,

Thanks for the response. But this would not take care of the situations where user would intentionally make dependency as inactive . on undoing that step we would forcefully make the dependency active back again


Post by tasnim »

I'm afraid, not aware of any other workaround. Please subscribe to the ticket so you'll be notified when there is any update.

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post Reply