Our state of the art Gantt chart


Post by johanbrodin »

Hi,

Please see the below gif. Why is the parent task generating a percentDone event when changing the duration of a child?

In the solution we are building the use can change pecentDone on some tasks but not others. And for the ones where the user do not have this option we want to show a "Toast". Since we cannot different if a percentDone event if it is triggered on a use task change or, as the example show below, a parent task being triggered by child task actions we cannot implement this use case.

percentDone.gif
percentDone.gif (10.12 MiB) Viewed 93 times
  onGanttChange(event: any) {
        if (event.changes != undefined && event.changes.percentDone != undefined) {
            var oldValue = event.changes.percentDone.oldValue;
            var value = event.changes.percentDone.value;
            var name = event.record._data.name;
            Toast.show(name + " percentDone -> " + " value: " + value + " oldValue" + oldValue);
        }
    }

Regards
Johan


Post by mats »

Since a parent task percent done is calculated, can't you simply exclude that in your listener?

        if (event.changes?.percentDone != undefined && !event.record.isParent) {

Post by johanbrodin »

Of course! I did not see that you could not manually change a parent percentDone and sorry for that. You can close the ticket.


Post Reply