I'm new to using the AlloyUI Scheduler. I have found how to display an alert if a item is saved, edited or deleted but I can't seem to find out how to show an alert if the item is moved, ie moved to another time or day. I would have thought that the 'edit' event would have handled this but apparently not. This is the code I have.
var eventRecorder = new Y.SchedulerEventRecorder({
on: {
save: function (event) {
alert('Save Event:');
},
edit: function (event) {
alert('Edit Event:');
},
delete: function (event) {
alert('Delete Event:');
}
}
});
var schedule = new Y.Scheduler(
{
boundingBox: '#myScheduler',
date: new Date(2018, 7, 25),
eventRecorder: eventRecorder,
items: events,
render: true,
views: [dayView, weekView, monthView, agendaView]
}
);
I did try :-
Moved: function (event) {alert('Moved');}
But it didn't work
For each view you'll need to listen to the
afterdrag:endevent for each view. Unfortunately, this event doesn't provide the draggedSchedulerEvent, so you'll need to obtain it in an appropriate way for each view:Just use a function like the one above during the
afterdrag:endevent for each view and you'll be able to obtain the new start and end dates of the dragged event.Runnable example: