Hello, I tried to add a "Duplicate event" in the context menu (like the example below), but I have a problem.
https://www.bryntum.com/examples/calendar/custom-menus/
I'm using, instead of a CrudManager, a project, and when I duplicate an event, the resources are not bound to the new event.
So I tried to add directly the assignments to the project (code below), but it doesn't work. Is there something I'm missing?
duplicateEvent({ eventRecord }) {
const dupe = eventRecord.copy();
// In case it was a recurring event, the dupe will be a one-off.
dupe.recurrence = null;
this.eventStore.add(dupe);
// On ajoute les assignements pour le nouvel événement
let newAssignments = [];
this.project.$assignmentStore._data.forEach(function (data) {
if (data.eventId === eventRecord.data.id)
newAssignments.push({ event: dupe.data.id, eventId: dupe.data.id, resource: data.resourceId, resourceId: data.resourceId })
});
this.project.$assignmentStore._data = this.project.$assignmentStore._data.concat(newAssignments);
this.refresh();
}