DayPilot.Gantt.onRowMoving with multiple positions
Asked by Leo 2 years ago.
We want to ensure that some DayPilot.Task elements cannot be converted to groups/parents when another Row is being dragged/moved on top of it.
However, it seems that args.position only allows for either "child", "before", "after" or "forbidden".
Is there any way to set “before“ and “after“, or only disallow child?
Otherwise, we run into the issue that some Rows cannot be dragged before or after the last Row item, as we seem to be able to only set before or after.
Answer posted by Dan Letecky [DayPilot] 2 years ago.
There are two options:
1. In the latest sandbox build (2023.3.5737), there is a new rowMoveSameLevelOnly property that lets you limit the target position of a row to the same level in the hierarchy of tasks.
2. In the onRowMoving event handler, you can check the conditions and forbid the "child" target position if that would mean converting an existing task into a group: