Is there a way to "Cancel" a update operation in drag mode?

Hi Team,

I wanted to make some validate in “onEventAdded” and “onEventChanged”, but how could I do to cancel the add/update operation when my validate failed?

In light box “Save” button, I could use “onEventSave” return “false” to do this.

Best wishes,

Judo520

onEventAdded and onEventChanged occurs to late, to block changes.
Instead you can try to use onBeforeEventChanged - this event occurs when dnd action finished, but before data saving was initiated.

Hi Stanislav,

Thanks for your reply, but both in help doc and in dhtmlxscheduler.js, I didn’t find “onBeforeEventChanged” event define, so I wanted to know how to use it?

Now, I’m trying to use “onBeforeDrag” event in my code.

Best wishes,

Judo520

onBeforeDrag occurs before event moving, so it seems to be not useful in your usecase.

documentation for onBeforeEventChanged added, and can be checked at
docs.dhtmlx.com/doku.php?id=dhtm … entchanged

Also, you can check sources of dhtmlxscheduler_limit.js which uses that event.

Hi Stanislav,

Thank you.

I found it in v2.2 and it worked well for normal events.

Best wishes,

Judo520