Page 1 of 1

[INFO REQ] Adding resources to project

Posted: Fri Jul 30, 2021 10:27 am
by DevHouse

I'm trying to add resources to my Gantt chart, but when editing the task in the dialog menu it says that there are "No results".

I've reproduced it in this codepen: https://codepen.io/isazulay/pen/xxdLeeO


Re: [INFO REQ] Adding resources to project

Posted: Fri Jul 30, 2021 10:35 am
by mats

Your Project is misconfigured. Please see https://bryntum.com/docs/gantt/#Gantt/model/ProjectModel#config-resourcesData

const project = new ProjectModel({
  startDate: new Date(2020, 0, 1),

  eventsData: [
    {
      id: 1,
      name: 'Write docs',
      test: true,
      expanded: true,
      children: [
        { id: 2, name: 'Proof-read docs', startDate: '2020-01-02', endDate: '2020-01-05' },
        { id: 3, name: 'Release docs', startDate: '2020-01-09', endDate: '2020-01-10' }
      ]
    }
  ],
  resourcesData: [
      {
        id: 1,
        name: "John Doe"
      },
      {
        id: 2,
        name: "Jane Doe"
      },
      {
        id: 3,
        name: "Doe Doe"
      }
    ],

  dependenciesData: [
    { fromEvent: 2, toEvent: 3 }
  ]
});

const gantt = new Gantt({
  project: project,
  appendTo: document.body,

  startDate: new Date(2019, 11, 31),
  endDate: new Date(2020, 0, 11),

  height: 300,

  columns: [
    { type: 'name' }
  ]
});