Premium support for our pure JavaScript UI components


Post by guillaume.morin »

Hello,

I have the following requirements on some events:

  • User cannot change its start date - it must always stay in sync with the predecessor end date

  • User can resize from the end - increase/decrease duration

  • User can drag event to change resource - but as said in #1, shouldn't be able to change start date with drag

I found those configs which would help, but they are are global, not per event:
https://bryntum.com/products/schedulerpro/docs/api/SchedulerPro/feature/EventResize#config-topHandle
https://bryntum.com/products/schedulerpro/docs/api/Scheduler/feature/EventDrag#config-constrainDragToTimeSlot

Any help how to achieve these would be appreciated.
Thanks.


Post by guillaume.morin »

Nevermind, this demo seems to cover most of my needs, I will report back if anything is missing.

https://bryntum.com/products/scheduler/examples/validation/


Post by guillaume.morin »

For the records, I was able to prevent moving an event having predecessors, while allowing change of resource using this one liner ... amazing !

listeners: 
{
	beforeEventDrag(e) {
		//Events with predecessors must not change time slot
		scheduler.features.eventDrag.constrainDragToTimeSlot = e.eventRecord.predecessors?.length > 0;
	}
}

Post by mats »

So all is working the way you want now?


Post by guillaume.morin »

Yes, all good, thanks.


Post Reply