Our state of the art Gantt chart


Post by mourad1081 »

Hello,

I am trying to implement a 'not earlier than' constraint using the builtin lag feature.

However, using that lag causes bugs in our app (because Bryntum sets as 0 the default lag value and that makes all the children tasks to squeeze when moving their parent).

It seems like the lag is a fixed distance between two tasks. I tried to set
autoCalculateLag
to false, but it does not solve the issue. I also tried
scheduleByConstraints: false
but not working either.

Hence, I want to use a custom variable representing my lag. In order to do so, I think I have to disable the handling of the lag by bryntum because I still need to create dependencies. Is there a way to disable that?

Thank you.

Example of what I meant by the "squeeze" bug:

Before moving the parent task
Image

After having moved the parent task
Image

Post by saki »

  1. I am trying to implement a 'not earlier than' constraint using the builtin lag feature.
    Is it something different from what we already have? I mean:
    Screen Shot 2019-12-08 at 19.19.01.png
    Screen Shot 2019-12-08 at 19.19.01.png (324.16 KiB) Viewed 1451 times
  2. default for autoCalculateLag is already false so setting it to the default value won't have any effect, same is true for scheduleByConstraints
  3. what would be the steps to reproduce the "sqeeze bug" on one of our examples?

Post by mourad1081 »

Hello, thanks for your reply.

1. Yes it is different because your "not earlier than" constraint is relative to a date, while what I am trying to implement is a "not earlier than" relative to a task. Thus, I want to be able to create this kind of constraint: "task A must start/finish not earlier than X days before the start/end of task B" but not "task A must start X days before the Xth of Y, 2019". There is no absolute date involved in my constraint.

2. Yes, indeed.

3. Yes, you can notice the squeeze "bug" in the examples as well:
3.1. Take this basic example: https://www.bryntum.com/examples/gantt-for-extjs/kitchensink/#examples/basic
3.2. Move the task "Follow up with customer" around the 23th Jan, 2017 for instance
3.3. Move the parent task "Build Prototype" anywhere
3.4. The parent has squeezed the children

Post by tso »

Any update on this?

Post by Maxim Gorkovsky »

Hello. Sorry for long reponse.
It appears that you want to set lag for new dependency automatically. In which case this config should help https://www.bryntum.com/docs/gantt-for-extjs/#!/api/Gnt.data.DependencyStore-cfg-autoCalculateLag. But I see it doesn't work when you add dependency from the task editor, only when dragging dependency line.

I added a ticket to fix this: https://app.assembla.com/spaces/bryntum/tickets/9491-task-editor-should-calculate-lag-for-new-dependencies-if-autocalculatelag-is-s/details

Try combination of autoCalculateLag on dependency store and this patch (make sure to apply before you instantiate Gantt):
Ext.define(null, {
    override : 'Gnt.widget.DependencyGrid',
    initComponent : function () {
        this.store = new Ext.data.JsonStore({
            autoDestroy :true,
            model : 'Gnt.model.Dependency',
            listeners : {
                update : function (store, record, operation, modifiedFields) {
                    // Source task was changed
                    if (modifiedFields.indexOf(record.fromField) !== -1) {
                        var from = record.getSourceTask(),
                            to   = record.getTargetTask();
    
                        // assuming end to start, add check for dependency type
                        record.setLag(Sch.util.Date.getDurationInUnit(from.getEndDate(), to.getStartDate(), record.getLagUnit()));
                    }
                }
            }
        });
        
        this.callParent(arguments);
    }
});
flag would set lag when you create dependencies by dragging and this patch will calculate lag in the task editor

Post Reply