Our state of the art Gantt chart


Post by Qwerty »

I have a fairly basic function which formats task data to be used in the Gantt chart which looks something like this
    let newNode = {
      name: node.data.text,
      startDate: node.data.start_date,
      endDate: node.data.end_date,
      ownerId: node.data.owner_id,
      percentDone: node.data.progress * 100,
      children: (node.children || []).map(c => this.makeSimpleHierarchy(c)),
      expanded: true
    };
Fields such as name, startDate, and percentDone seem to be added correctly and can be seen in the data section of the task model. ownerId is my own custom field and even though it is added in the same way as the other values it shows up on the task model instance itself rather than in the data section. Is this the correct way to add custom data to a task and is there any way I can get it to show up with the rest of the attributes like name in `data`

Post by mats »

You should define your own model representing your entities, please see docs for examples: https://bryntum.com/docs/scheduler/#Common/data/Model

Then configure your store to use your new `modelClass`

Post Reply