Our state of the art Gantt chart


Post by sourabh.joshi »

When i am adding dependencies-(predecessor or successor) from edit popup,
I am not getting any dependency info in editor context of onAfterTaskSave method.

Please correct me where i can get that values when i give predecessor and successor values.

and also from timeline when i make dependencies from one task point to another task point,
what is the method to get their response


Post by tasnim »

Hi,

You could a get those like below

    listeners : {
        afterTaskEdit(props) {
            console.log(props.taskRecord.successors);
            console.log(props.taskRecord.predecessors);
        }
    }

Post by sourabh.joshi »

I am using this code

<BryntumGantt
      ref={props.ganttRef}
      {...props.ganttConfig}
      tasks={props.tasks}
      cellEditFeature={props.cellEditFeature}
      onAfterTaskEdit={(data: any) => {
        console.log(data);
      }}
    />

and the response in console
for taskRecord parameter and eventRecord parameter

Screenshot from 2023-06-06 13-28-10.png
Screenshot from 2023-06-06 13-28-10.png (147.83 KiB) Viewed 276 times
Screenshot from 2023-06-06 13-28-21.png
Screenshot from 2023-06-06 13-28-21.png (160.09 KiB) Viewed 276 times

here i am not getting any parameter named successors or predecessors


Post by alex.l »

Did you try to put debugger and call taskRecord.successors?
https://bryntum.com/products/gantt/docs/api/Gantt/model/TaskModel#property-successors

All the best,
Alex


Post by sourabh.joshi »

got it on edit popup
but not when dragging/connecting tasks.


Post by alex.l »

What are you trying to do? Add validation, prevent connection, trigger saving?
Here is a bunch of events you can use, but we need to know what exactly you are trying to do, to suggest you something https://bryntum.com/products/gantt/docs/api/Scheduler/feature/mixin/DependencyCreation#events

All the best,
Alex


Post by sourabh.joshi »

I want to connect task bar points.
example image

My project-1.png
My project-1.png (62.69 KiB) Viewed 193 times

I want to connect task 1's end point to task 2's start point
which i have highlighted in image
just tell me the event name, which event gets fired when we connect one task's end point to another task's start point.

Using thios code but not getting any console

<BryntumGantt
      ref={props.ganttRef}
      {...props.ganttConfig}
      tasks={props.tasks}
      dependenciesFeature={{
        listeners: {
          afterDependencyCreateDrop: (context: any) => {
            console.log(context);
          }
        }
      }}
      columnReorderFeature={props.columnReorderFeature}
      onTaskEditCanceled={props.onTaskEditCancel}
      onBeforeCellEditStart={props.onBeforeCellEditStart}
      taskEditFeature={props.taskEditFeature}
    />

Post by marcio »

Hey sourabh.joshi,

As you can see in the documentation link https://bryntum.com/products/gantt/docs/api/Scheduler/feature/mixin/DependencyCreation#event-afterDependencyCreateDrop, the event is marked as on-owner, that means that you should add the listener to the Gantt listeners object like this:

<BryntumGantt
        ref={ganttRef}
        {...ganttConfig}
        dependenciesFeature
        listeners={
          {
            afterDependencyCreateDrop: (context) => {
              console.log(context);
            }
          }
        }/>

Best regards,
Márcio


Post by sourabh.joshi »

Yaa i got the response there in listner.
thanks for that
but here also one more que.
that we connect any point of one task to another task

so it has types

start-to-start
start-to-end
end-to-end
end-to-start

where are this types in response

and also when we pass dependecy list to bryntum gantt
acc. to documentation we have dependency object like:

{
id:1,
from:123,
to:456,
lag:2
}

so in this object how should i pass the type


Post by mats »


Post Reply