Hi Oscar,
Thank you for contacting Syncfusion support
We have analyzed your requirement. In Resourceview Gantt we can get the successor of the each task by using the task predecessor collection with some work around. Please find the below code snippet.
|
TS]
constructor() {
taskbarClick(args) {
var ganttObj = $("#resourceGantt").ejGantt("instance"),
proxy = this,
successorrecord = [],
taskName = [],
predecessor = args.data.predecessor,
data = args.data;
if (!ej.isNullOrUndefined(predecessor)) {
for (var i = 0; i < predecessor.length; i++) {
if (predecessor[i].from == data.item.taskID) {
var record = ganttObj._getRecordByTaskId(predecessor[i].to);
successorrecord.push(record.item.taskName)
}
}
if (successorrecord.length)
alert("Successor TaskNames=" + successorrecord)
else
alert("No Successor Tasks")
}
}
[HTML]
<ej-gantt id="resourceGantt"
[dataSource]="resourceGanttData"
[viewType]=viewType
(taskbarClick)="taskbarClick($event)"
//...
>
</ej-gantt> |
In the work around solution we had use our internal private method(_getRecordByTaskId) to get the tasks by using “taskId” and we will implement the public method support for get the tasks by using “taskId”.
We have prepared the sample for your reference. In sample when click the Gantt taskbar then the successor of that task will be shown in the alert message.
Please find the sample link below
Please let us know if you require further assistance on this.
Regards,
Punniyamoorthi