Hi,
I want to ask a question on a problem we have. We can solve the problem with rather ugly workarounds however you might have a better way!
Our app has multiple listeners for different tasks manipulations. One example is if you change a task name we will store the value in a remote system.
However when the (onDataChange) event is called we cannot resolve if the change is because of a user manually changing a value e.g. name or if it is a new task inserted with code. Also a bug we see is inserting multiple tasks with "this.gantt.addTaskBelow" (onDataChange) is called only for the first task.
So all to all have you considered to add e.g. an event.type in (onDataChange) with e.g. manual or api as value to differentiate. Or have you another recommend way filter out user input events.
//Catching event
onGanttChange(event: any) {
try {
if (event.action == "update") {
if (event.changes.name != undefined && (event.changes.name.oldValue != event.changes.name.value)) {
//we only want to be here if the use enters the change manually
}
}
} catch (err) { }
}
//triggers onGanttChange to be called - also as described below onGanttChange is only called for the first issue which seems like a bug...
for (var i = 0; i < issues; i++) {
var issue = issues[i];
var tmp: any = await this.gantt.addTaskBelow(tmp);
tmp.name = issue.name;
tmp.percentDone = issue.progress
}
Regards
Johan