Our state of the art Gantt chart


Post by mmelcot »

We noticed a bug on tasks getters 'getIncomingDeps()' and 'getOutgoingDeps()'.
These getters (or the related attributes) always return '0', in case we load the TaskStore and DependencyStore not with a proxy, but with the `loadData` or `add` functions.

To reproduce the bug:
Define a custom renderer show the incoming/outgoing dependencies on top of the tasks
    taskRenderer( { taskRecord, tplData } ) {
      return `<div >In: ${taskRecord.getIncomingDeps().size} / Out: ${taskRecord.getOutgoingDeps().size} </div>`;
    }
In the browser console, manually load tasks and dependencies:
storeData = [
    {
        "id": 11,
        "name": "Task 11",
        "percentDone": 50,
        "startDate": "2020-01-14",
        "duration": 3,
        "color": "teal",
        "endDate": "2020-01-17"
    },
    {
        "id": 15,
        "name": "Task 15",
        "percentDone": 0,
        "startDate": "2020-01-21",
        "duration": 2,
        "endDate": "2020-01-23"
    }
];
GanttPtr.taskStore.loadData(storeData);

depData=[{
    "id"       : 1,
    "fromTask" : 11,
    "toTask"   : 15,
    "lag"      : 2
}];
GanttPtr.dependencyStore.loadData(depData);
=> This will show 'In: 0, Out: 0' for both blocks.

If tasks and dependecies are loaded through proxies it works.

Post by sergey.maltsev »

Hi!

Try to use GanttPtr.project.propagate() method after loading data and check if this works.

https://www.bryntum.com/docs/gantt/#Gantt/model/ProjectModel#function-propagate

Post by mmelcot »

ok it worked! thanks Sergey

Post by sergey.maltsev »

Glad to hear this.
You are welcome!

Post Reply