search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Event Resizing Validation - Do not allow event overlapping even when "allowEventOverlap=true"

Asked by Renato
3 months ago.

Hi, I’m trying to do a scheduler in react where when I move an event to another one instead of overlapping it switches them and that is working great! But now I have a problem where if 2 events are in the same row and I resize one to be overlapping the other it allows me to do it, and I wanna prevent that from happening.

I tried using “onEventResizing” but I’m not being able to code it in a way that works can you help me?

Answer posted by Dan Letecky [DayPilot]
3 months ago.

You can do it like this:

onEventResizing: args => {
    const row = dp.rows.find(args.e.resource());
    const events = row.events.forRange(args.start, args.end).filter(e => e.id() !== args.e.id());
    if (events.length > 0) {
        args.allowed = false;
    }
}
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.