Home Unanswered Active Tags New Question

Resize a calendar event from JavaScript

I want to resize an existing calendar event from JavaScript. The resize will be triggered by the user selecting the new start or end time from a pair of dropdown boxes. I already have a JS method that handles this event from the calendar, but I want to be able to call that function myself. My problem is how to instantiate and populate a DayPilotCalendar.Event object on the client side, as the start and end properties are only exposed as getter methods.

So I think what I'm looking for is something like this:
var e = new DayPilotCalendar.Event();
e.setStart(oldStartDate);
e.setEnd(oldEndDate);
rangeResized(e, newStartDate, newEndDate); // My existing resize event handling method, which invokes the CallBack functionality

Thanks,
Matt
Asked by Matt 4 years ago.
Replies
It's not quite ready for such scenario at the moment. I would like to upgrade the Event class into a regular class that can be used from the user code in one of the future releases.

But you can use the following workaround:

var e = new DayPilot.Event(id);

DayPilot.Event is declared in Common.js. This will not provide correct values in OldStart and OldEnd in the server-side EventResize handler but the event id (Value) will be passed properly.
Comment posted by Dan Letecky 4 years ago.
New Reply
This reply is
Your name (optional):

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