I need help to do a validation on drag-and-drop. The task not allowed to move to the root, she always need the project before (at a root) or another task with a project before. Its possible to have n projects but the projects need to be in root of gantt(validation I already did).
I try to use “OnBeforeTaskMove” and task.$level but is not working.
Anyone helps me?
You can use the
onBeforeRowDragEnd and check the task parent there:
When the parent is
0, you return false.
Here is an example of how it might be implemented:
You can also check the following sample where you can cancel reordering tasks: