Our state of the art Gantt chart


Post by Jerther »

Hi!

I just started working on duplicating a task tree including its dependencies and something is a bit confusing. I was about to duplicate the dependencies (predecessors and successors) of the original task before adding the duplicated task to the taskStore, and I stumbled on already existing dependencies in the duplicate. Let me illustrate:

  • Start with the Basic Demo
  • Put the gantt instance on window: window.gantt = new Gantt(...
  • Delete the root task
  • Now in the console, add a new root task:
    var rootTask = gantt.taskStore.rootNode.appendChild({ name : 'New task' })
  • Right click that new task, and add a new subtask
  • Then right that task, and add a new one below
  • Edit the two subtasks and add some duration
  • Then drag a dependency from the end of the first subtask to the start of the second
  • Now in the console, copy the root task:
    var duplicate = rootTask.copy({deep: true})
  • :!: Then look at duplicate.children[0].successors. There's one, and its fromTask and toTask properties are pointing to the original tasks!
  • Add the duplicate to the taskStore:
    gantt.taskStore.add(duplicate)
  • Take another look at duplicate.children[0].successors. Now there is none! And indeed none is shown in the chart.

Not sure if that's intended or not :? I was expecting the duplicated task to have no successor or predecessor.


Post by mats »

Thanks for another clear bug report, it should not copy dependencies. Ticket opened: https://github.com/bryntum/support/issues/1075


Post by Jerther »

Still happens in 5.0.3, and copy command now is:

var duplicate = rootTask.copy({}, true)

Post by alex.l »

Yes, the ticket is not resolved yet. It will have "Resolved" status when it's done.

All the best,
Alex


Post Reply