Updating a task record to make it the child of another task

Hi,

In the documentation on this page: Managing Tasks in Vue Gantt component, it says that updateRecordByID(record, "Child") can be used to edit a record, however, it does not seem to be able to edit the record such that it changes the parent/child relationship.

In the screenshot below, what function should I call to make "Child Task" a child of "Parent Task"?



1 Reply 1 reply marked as answer

PP Pooja Priya Krishna Moorthy Syncfusion Team March 30, 2021 12:54 PM UTC

Hi Samantha, 
We cannot update parent-child relationship by using the public method updateRecordByID method. As we update the tasks based on column fields. 
Instead, we can modify the data source as like below code example and refresh the Gantt. 
 
 
methods: { 
    update: function () { 
      var obj = document.getElementById("Gantt").ej2_instances[0]; 
      var data = extend([], obj.dataSource, true); 
      data[4].parentID = 4; 
      obj.dataSource = data; 
    }, 
}, 
 
 
Regards, 
Pooja K. 


Marked as answer
Loader.
Up arrow icon