I am using angular 14 application in which I am using dhmlx-scheduler node package. The angular code uses java api to store the data in postgres DB. Th issue I am facing is after referring to your tutorial (Create Angular Scheduler with dhtmlxScheduler [Tutorial] - DHTMLX Blog), I used createDataProcessor to catch the events. However, the data captured during update/delete/create event does not have any of the custom fields (like color, login, priority which I am using in lightbox) . It only has the default fields like start_date, end_date, event_pid, rec_type etc.,
const dp = scheduler.createDataProcessor(async (entity: any, action: any, data: any, id: string ) => {
if(data['!nativeeditor_status']) {
switch (action) {
case "create":
const d: any = {
schedulerId: data.id,
startDate: new Date(data.start_date),
endDate: new Date(data.end_date),
text: data.text,
login: this.loginId,
eventPid: data.event_pid || 0,
eventLength: data.event_length || 0,
recType: data.rec_type || '',
eventColor: data.priority == '1' ? '#EE8E97' : (data.priority == '2' ? '#92E0A3' : '#E0AE8F'),
}
return this.http.addEvent(d).then(resp => {
window.location.reload();
});
break;
case "update":
//all modified occurrences must be deleted when you update a recurring series
if (data.rec_type && data.rec_type != "none") {
this.http.deleteModifiedOccurrences(data.id);
}
const updateData: any = {
schedulerId: data.id,
startDate: new Date(data.start_date),
endDate: new Date(data.end_date),
text: data.text,
login: this.loginId,
eventPid: data.event_pid || 0,
eventLength: data.event_length || 0,
recType: data.rec_type || '',
eventColor: data.priority == '1' ? '#EE8E97' : (data.priority == '2' ? '#92E0A3' : '#E0AE8F'),
}
return this.http.updateEvent(updateData).then(resp => {
window.location.reload();
});
break;
case "delete":
if (data.event_pid != 0) {
// deleting modified occurrence from a recurring series
// If an event with the event_pid value was deleted,
// it should be updated with "rec_type==none" instead of deleting.
return this.http.updateRecType(data.event_pid);
}
else if (data.rec_type && data.rec_type != "none") {
// if a recurring series deleted, delete all modified occurrences of the series
this.http.deleteModifiedOccurrences(data.id);
return this.http.deleteParentEvent(data.id);
}
window.location.reload();
break;
}
throw new Error(`Action [${action}] is not implemented`);
}
});
this.getEvents();