Premium support for our pure JavaScript UI components


Post by msorys »

Hi!

I have a question, how can i disable to set wrong date on edit event, create, drag and drop?

Wrong date is date before current day. User can't schedule the event on the preceding day of today.


Post by alex.l »

HI msorys,

You need to add validation for these actions.
https://bryntum.com/docs/scheduler/#Scheduler/feature/EventDragCreate is responsible for creation new events by dragging.
It has the https://bryntum.com/docs/scheduler/#Scheduler/feature/EventDragCreate#config-validatorFn

https://bryntum.com/docs/scheduler/#Scheduler/feature/EventDrag allows user to drag and drop events within the scheduler, to change startDate or resource assignment.
It also has the https://bryntum.com/docs/scheduler/#Scheduler/feature/EventDrag#config-validatorFn

Events also may be changed using EventEdit dialog https://bryntum.com/docs/scheduler/#Scheduler/feature/EventEdit
and it has
https://bryntum.com/docs/scheduler/#Scheduler/feature/EventEdit#event-beforeEventSave
https://bryntum.com/docs/scheduler/#Scheduler/feature/EventEdit#event-beforeEventAdd
https://bryntum.com/docs/scheduler/#Scheduler/feature/EventEdit#event-beforeEventEdit
that will be helpful to check.

Events may be resized, so this feature is also must be checked https://bryntum.com/docs/scheduler/#Scheduler/feature/EventResize
https://bryntum.com/docs/scheduler/#Scheduler/feature/EventResize#config-validatorFn

You may also be needed to handle more places to cover all cases of create/add/edit operations depends on set of features you use and your custom UI elements. Check docs for features you used, it will definitely has a good place to add validation.

All best,
Alex

All the best,
Alex


Post Reply