DayPilot.Scheduler.onEventResizing

Real-time event that is fired whenever the event shadow is resized during drag & drop event resizing.

Declaration

onEventResizing(args)

Parameters

  • args.start - start date/time of the current position (DayPilot.Date object)
  • args.end  - end date/time of the current position (DayPilot.Date object)
  • args.duration - duration of current position (DayPilot.Duration object)
  • args.e - event object (DayPilot.Event object)
  • args.allowed - set to false to forbid the operation
  • args.left.html - HTML of the inline start indicator; default value is set to args.start.toString(calendar.eventMovingStartEndFormat)
  • args.left.enabled - when set to true, the inline start indicator is displayed; default value is set to calendar.eventMovingStartEndEnabled
  • args.right.html - HTML of the inline end indicator; default value is set to args.start.toString(calendar.eventMovingStartEndFormat)
  • args.right.enabled - when set to true, the inline end indicator is displayed; default value is set to calendar.eventMovingStartEndEnabled

Example

External message

dp.onEventResizing = function(args) {
  $("#msg").html(args.start + " " + args.end + " " + args.duration);
};

Inline message

dp.onEventResizing = function(args) {

  if (args.duration.totalHours() > 4) {
      args.left.enabled = false;
      args.right.enabled = true;
      args.right.html = "The event cannot take more than 4 hours";

      args.allowed = false;
  }
};

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java