Skip to main content

onBeforeEventChanged

Description

Fires when the event has been changed by drag-n-drop, but the changes aren't saved yet.

onBeforeEventChanged: (ev: object, e: Event, is_new: boolean, original: object) => boolean

Parameters

  • ev - (required) object - the event's data object after changes
  • e - (required) Event - a native event object
  • is_new - (required) boolean - returns 'true', if the user changes a new event. 'false' - if the edited
    event already exists
  • original - (required) object - the event's data object before changes

Returns

  • result - (boolean) - defines whether the default action of the event will be triggered (true) or canceled (false)

Example

scheduler.attachEvent("onBeforeEventChanged", function(ev, e, is_new, original){
//any custom logic here
return true;
});

Details

The event occurs when a new "event" is added or an existing one is changed by drag-n-drop action.

  • Beware that the 1st parameter of the handler function takes the data item object, not the data item's id (because newly created data items may not have ID yet).
  • Unmodified event would be an empty object in case of creating new data items.
  • The event is blockable: returning false from the handler will prevent data update.
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.