Our state of the art Gantt chart


Post by Nualis »

Hi,

We are trying to change the childrenField configuration for the Gantt within a Vue project, so that our datamodel is not mandatory to have the nested collection named 'children'. Can you provide us with some examples how this can be done with a ganttConfig?

Post by mats »

It's described in our docs: https://bryntum.com/docs/gantt/#Gantt/model/TaskModel#property-childrenField-static
MyModel.childrenField = 'kids';
const parent = new MyModel({
  name : 'Dad',
  kids : [
    { name : 'Daughter' },
    { name : 'Son' }
  ]
});

Post by Nualis »

We saw that example (before), but do we need to add a specific model for this to work? Is it not possible to configure it on the Gantt itself? We are now providing the data for the Gantt via without a specific model:
this.gantt = new Gantt(ganttConfig);
this.gantt.store.data = this.tasks;

Post by Animal »

this.gantt = new Gantt(ganttConfig);
this.gantt.taskStore.modelClass.childrenField = 'kids';
this.gantt.store.data = this.tasks;

Post Reply