I'm using the keyboard API in the following events:
onTimeRangeSelecting: (args) => {
// Update the keyboard focus during time range selection (cell click)
if (!args.row.data.frozen) {
this.scheduler.control.keyboard.focusCell(args.start, args.resource);
}
},
onEventClick: (args) => {
// Update the keyboard focus
this.scheduler.control.keyboard.focusEvent(args.e);
},
onEventEdited: (args) => {
// https://forums.daypilot.org/question/5600/strange-behaviour-when-navigating-using-keyboard-api-after-
this.scheduler.control.keyboard.focusEvent(args.e);
}
All three calls causes the following error, that occures only after changing the resources and events at once:
logging.service.ts:11 TypeError: Cannot read properties of undefined (reading 'lines')
at Object.I.Qr (daypilot-core.js:35:3672)
at Object.I.Sr (daypilot-core.js:35:4069)
at Object.I.Ik (daypilot-core.js:35:3909)
at Object.b.doit (daypilot-core.js:27:6054)
at Object.b.request (daypilot-core.js:27:5805)
at DayPilot.Scheduler.update (daypilot-core.js:27:5635)
at DayPilotSchedulerComponent.ngDoCheck (daypilot-angular.js:4:2400)
at callHook (core.mjs:2536:1)
at callHooks (core.mjs:2495:1)
at executeCheckHooks (core.mjs:2427:1)
I'm showing in the scheduler the data of a selected person. Everytime I select a person, the resources and events properties of the scheduler are initialized with data of that person.
// Reset both arrays
this.resources = new Array();
this.events = new Array();
this.resources = this.getResources(this.person);
this.events = = this.getEvents(this.person);
this.scheduler.control.update({ resources: this.resources });
The events property is binded like this:
<daypilot-scheduler [config]="schedulerConfig" [events]="events" #scheduler>
</daypilot-scheduler>
Is there maybe another way to do it in order to prevent this error?