Our state of the art Gantt chart


Post by zhang »

Here are the details:
Suppose there are three tasks in the Gantt chart, where task 1 points to Task 2 and task 2 points to task 3. Now, I, as the user, want to direct Task 1 to task 3, removing the dependencies between task 1 and task 2 and between task 2 and task 3. I tried it and found that I could not delete the connection between tasks. Is it possible that the connection node cannot operate?
Looking forward to reply


Post by mats »

You can delete dependencies at any time, options:

  1. Use https://bryntum.com/docs/scheduler/api/Scheduler/feature/DependencyEdit and double click a line

  2. Delete dependency in the task editor (double click a task)

  3. delete dependency in the predecessor or successor columns


Post by zhang »

thank you , i get it.


Post by zhang »

If I want to double click on a line, remove the dependency between two tasks through the API instead of the default interaction, something like that

ganttRef.current.instance.removeDependence(dependenceId)

Is there an API?


Post by tasnim »

Hi,
To achieve that you need to first listen to the double click event on the dependency and then you need to remove it.
Please check these docs link below:
https://bryntum.com/docs/gantt/api/Gantt/data/DependencyStore#function-remove
https://bryntum.com/docs/gantt/api/Gantt/feature/Dependencies#event-dependencyDblClick

Here is how you can achieve it:

  1. Go inside of your ganttConfig
  2. add listeners object inside of ganttConfig
  3. Then add dependencyDblClick inside of listeners

Code snippet:

ganttConfig = {
	....
	listeners : {
		dependencyDblClick({ dependency }) {
			// remove the dependency
			this.dependencyStore.remove(dependency);
		}
	}
}

Best regards,
Tasnim


Post Reply