An initial scheduler is generated using default data no problem. After user interaction with checkboxes outside the scheduler there is a need to refetch the resources/events to refresh the scheduler. When attempting to assign the new data to this.dp.resources the following message is produced:
message: "Cannot set properties of undefined (setting 'resources')"
stack: "TypeError: Cannot set properties of underfined"
The same message is produced when trying to hardcode in the values with the given example in article: https://api.daypilot.org/daypilot-scheduler-update/
Code snippet
async updateCalendar() {
let updatedResources = await this.getRefreshedResources();
this.resources = unwrapResource(updatedResources);
let updatedEvents = await this.getRefreshedEvents();
this.events = unwrapEvent(updatedEvents);
//this.dp.resources = this.resources; <---This line failes
this.dp.resources = [ {name: 'Core', id: 'a1x3J000000lTDQQA2'},{name: 'Cafe', id: 'a1x3J000000lTDRQA2'},]; // <--This line also failes
this.dp.events.list = this.events; //<--This line will also fail if the resource line is commented out with the same error
this.dp.update();
}
Do the resources/events need to be cleared before re-initializing?