How to constrain event dragging to vertical-axis (resource) only
Posted: Fri Sep 20, 2019 8:59 am
Hi,
I am currently working on a prototype application to investigate whether the Bryntum Scheduler matches our UX requirements. One of these requirements is that users should only be able to move (drag) events to different resources, but not be able to change their date&time. This corresponds to locking the horizontal-axis, but allow dragging in the vertical-axis.
So far I have only been able to find the opposite of this requirement using:
This constrains dragging events to the horizontal-axis. Our requirements are exactly the opposite of this. What is the preferred method to constrain dragging to the vertical-axis (locked start & end times)?
Visually the UX designers are pushing for a solution where the dragged event proxy element only moves freely in the vertical direction, so simply using validation is not enough. I sort of have been able to achieve this effect using the following code:
This works, but is a bit buggy when you are dragging an event to the edge and scheduler starts scrolling.
I also tried to make use of the scheduler.getDateConstraints function, but without success. I can see the function being called whenever I start dragging an event, but the output of this function seems to be ignored.
I am currently working on a prototype application to investigate whether the Bryntum Scheduler matches our UX requirements. One of these requirements is that users should only be able to move (drag) events to different resources, but not be able to change their date&time. This corresponds to locking the horizontal-axis, but allow dragging in the vertical-axis.
So far I have only been able to find the opposite of this requirement using:
constrainDragToResource
Visually the UX designers are pushing for a solution where the dragged event proxy element only moves freely in the vertical direction, so simply using validation is not enough. I sort of have been able to achieve this effect using the following code:
function lockEventTimeWhileDragging(scheduler: Scheduler): void {
scheduler.features.eventDrag.drag.lockX = true;
scheduler.addListener({
beforeEventDropFinalize:
({ context }: BeforeEventDropFinalizeEventData) => context.timeDiff = 0
});
}
I also tried to make use of the scheduler.getDateConstraints function, but without success. I can see the function being called whenever I start dragging an event, but the output of this function seems to be ignored.