Stop adding child nodes to Phase tasks while task and phase drag and drop

How to stop adding child nodes while drag and drop tasks and phases across phases and inside phase.


1 Reply 1 reply marked as answer

GM Gopinath Munusamy Syncfusion Team September 23, 2022 12:00 PM UTC

Hi Kumar,

Greetings from Syncfusion support.


We have checked your query and we have prepared a work around sample to achieve your requirement. In this sample, we have prevented the drop action based on the position as middleSegment using the rowDrop Event. By this you can able to achieve your requirement to prevent dropping as a child task. We have attached a sample and code snippets for your reference, please check the below sample and code snippets for more details.


Code snippets:

[app.component.html]

 

<ejs-gantt (rowDrop)="rowDrop($event)">

</ejs-gantt>

 

[app.component.ts]

 

public rowDrop(args: any) {

    if (args.dropPosition == 'middleSegment') {

      args.cancel = true;

    }

  }


Sample: https://stackblitz.com/edit/angular-tbgrxy?file=app.component.html,app.component.ts

UG Documentation: https://ej2.syncfusion.com/angular/documentation/gantt/rows/#validating-drop-position

Regards,

Gopinath M


Marked as answer
Loader.
Up arrow icon