Our state of the art Gantt chart


Post by aneventchin »

Hello, I am importing data in the gantt manually, with structure that has 'percentDone' written as 'percentComplete'. Here is the 'originalData' property of the row:

{
name: "Complete demand plan"
percentComplete: 50
...
}

I have the gantt config like this:

const ganttConfig = {
...
    columns: [
...
      {
        type: 'percentdone',
        field: 'percentComplete',
        showCircle: true,
        width: 70,
        editor: false,
      },
    ],

...

Unfortunately, the column displays '% Done' as 0. How can I link my custom property to the 'percentDone' column?


Post by saki »

It can be solved on the data level, see please https://bryntum.com/docs/scheduler-pro/#Core/data/Model#field-data-mapping

Then you would use your extended class, for example MyTaskModel as a config option of project:

    project : {
        // Let the Project know we want to use our own model with custom fields / methods
        taskModelClass : MyTaskModel,

as in https://bryntum.com/examples/gantt/advanced/ example


Post by aneventchin »

I have defined a Task Model ->

export class Task extends TaskModel {
  static get fields() {
    return [
      {
        name: 'percentComplete',
        type: 'integer',
        dataSource: 'percentComplete',
      },
    ];
  }
  ...

The result is the same.


Post by saki »

Try with name percentDone but remove field from the column config.


Post by aneventchin »

That worked! Thank you!


Post Reply