Page 1 of 1

[SchedulerPro] Prevent changing start date of event

Posted: Fri Mar 31, 2023 4:06 pm
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.


Re: [SchedulerPro] Prevent changing start date of event

Posted: Fri Mar 31, 2023 9:57 pm
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/


Re: [SchedulerPro] Prevent changing start date of event

Posted: Fri Mar 31, 2023 10:54 pm
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;
	}
}

Re: [SchedulerPro] Prevent changing start date of event

Posted: Fri Mar 31, 2023 11:20 pm
by mats

So all is working the way you want now?


Re: [SchedulerPro] Prevent changing start date of event

Posted: Fri Mar 31, 2023 11:23 pm
by guillaume.morin

Yes, all good, thanks.