Our state of the art Gantt chart


Post by bdowza »

Hi all,

I've noticed that changing the duration value from the Gantt chart columns responds with information inconsistent with the Task Editor and Grid dragging.
If I were to drag the task on the grid to change the duration, or update the duration from the Task Editor then I receive a response like:

"tasks": {
    "updated": [
      {
        "duration": 6,
        "endDate": "2020-01-09T05:00:00.000Z",
        "id": "200"
      },
      ...

Though, if I update the duration from the Duration Column, then I get the following response:

"tasks": {
  "updated": [
      {
        "duration": {
          "_magnitude": 5,
          "_unit": "day"
        },
        "id": "200"
      },
      ...

^ This ends up nulling out the end date as well.
Is this expected?


Post by bdowza »

(This is on gantt-2.1.4)


Post by bdowza »

I was able to get it working properly and it appeared to be tied to how we were defining our columns...

Specifying the field property in the Column definitions seems to cause the issue. If I remove the field property from the below example, then the changes to the duration cell work as expected.

ganttEngine.current = new Gantt({
	...
      columns: [
        ....
        { type: "duration", field: "duration", text: "Duration" },
      ],
      ....

Post by bdowza »

Looks like it was our issue. We should've been either omitting field or using field: fullDuration


Post by mats »

Yes that's correct, thanks for posting how you fixed it!


Post Reply