I'm getting the error:
TypeError: Cannot read property 'on' of undefined
at ResourceHeader.set resourceStore [as resourceStore] (scheduler.module.js:111136)
at VerticalEventMapper.set resourceStore [as resourceStore] (scheduler.module.js:110108)
at VerticalEventMapper.onChangeResourceStore (scheduler.module.js:110133)
at Scheduler.trigger (scheduler.module.js:3615)
at eval (scheduler.module.js:3628)
at Array.forEach (<anonymous>)
at ResourceStore.trigger (scheduler.module.js:3624)
at ResourceStore.loadData (scheduler.module.js:33997)
at ResourceStore.set data [as data] (scheduler.module.js:33883)
at Scheduler.set resources [as resources] (scheduler.module.js:105944)
The error occurs in componentDidUpdate
when this code is called:
if (prevProps.resourcesVersion !== props.resourcesVersion) {
engine.resources = props.resources;
}
This happens if 'listeners' is NOT passed as prop to BryntumScheduler component.
IF 'listeners' is passed as prop though, then vertical view is working back again BUT horizontal mode is broken:
some listeners are called, others not and contents behind the viewport are not rendered (scrolling horizontally reveals empty grid).
Here is the listeners
object being passed to horizontal and vertical views/modes:
{
beforeEventSave: ({ eventRecord, values }) => {
// the code here...
},
beforeEventEditShow: ({ eventRecord, resourceRecord, editor }) => {
// the code here...
},
beforeEventDelete: async ({ eventRecords, source }) => {
// the code here...
},
afterEventDrop: async ({ eventRecords, valid }) => {
// the code here...
},
eventResizeEnd: async ({ changed, eventRecord }) => {
// the code here...
}
}
I do not want to replace/remove all schedulers. I want to replace/set ONLY the above 5 listeners and leave others as they are defined by default in scheduler module.