hi,
Am getting the the error "Cannot read property 'overAnyHandle' of undefined" when clicking on any event. This happens when I use feature={} in my React scheduler. Below is my config
<BryntumScheduler
ref={scheduler}
id="schedulerComponent"
rowHeight={50}
barMargin={4}
features={{ // This is causing the issue
stripe: true,
group: 'Shift',
sort: 'Name',
resourceTimeRanges: {
store: availability,
},
}}
columns={[
{ text: 'Name', field: 'Name', width: 130 },
{ text: 'Location', field: 'Location', flex: 1 },
{ text: 'Tot PP', field: 'totPP', flex: 1 },
]}
crudManager={{
resourceStore: resources,
eventStore: events,
}}
resources={props.resources}
resourceTimeRanges={props.availableData}
events={props.eventsData}
eventRenderer={eventRender}
viewPreset={{
base: 'hourAndDay',
columnLinesFor: 0,
headers: [
{
unit: 'd',
align: 'center',
dateFormat: 'ddd DD MMM',
},
{
unit: 'h',
align: 'center',
dateFormat: 'HH:mm',
},
],
}}
startDate={new Date(2020, 2, 23, 5)}
endDate={new Date(2020, 2, 23, 17)}
/>
Support Forum
I've tested resourceTimeRanges with our simple React demo and adding these lines to containers/Main.js shows resource time ranges:
resourceTimeRangesFeature={true}
resourceTimeRanges={[
{
id: 1,
resourceId: 'a',
startDate: '2017-02-07 15:00',
endDate: '2017-02-07 17:00',
name: 'Dentist'
},
{
id: 2,
resourceId: 'c',
startDate: '2017-02-07 09:00',
endDate: '2017-02-07 12:30',
name: 'Parental leave'
}
]}
Can you try with a store and model defined to the resourceTimeRangesFeature. I tried with 3.1.1 same result.saki wrote: ↑Thu Apr 02, 2020 11:37 am I've tested resourceTimeRanges with our simple React demo and adding these lines to containers/Main.js shows resource time ranges:
resourceTimeRangesFeature={true} resourceTimeRanges={[ { id: 1, resourceId: 'a', startDate: '2017-02-07 15:00', endDate: '2017-02-07 17:00', name: 'Dentist' }, { id: 2, resourceId: 'c', startDate: '2017-02-07 09:00', endDate: '2017-02-07 12:30', name: 'Parental leave' } ]}
resourceTimeRangesFeature={{
store: resourceTimeRangeStore,
}}
The following works for me (tested in simple React Scheduler demo, file containers/Main.js):
where resourceTimeRangeStore is created beforehand in render method:
ResourceTimeRangeStore class must be imported, of course:
The result is:
<BryntumScheduler
ref={'scheduler'}
resourceTimeRangesFeature={{
store:resourceTimeRangeStore
}}
render = () => {
const resourceTimeRangeStore =
this.resourceTimeRangeStore ||
new ResourceTimeRangeStore({
data: [
{
id: 1,
resourceId: 'a',
startDate: '2017-02-07 15:00',
endDate: '2017-02-07 17:00',
name: 'Dentist'
},
{
id: 2,
resourceId: 'c',
startDate: '2017-02-07 09:00',
endDate: '2017-02-07 12:30',
name: 'Parental leave'
}
]
});
return (
<Aux>
<Header
import { Toast, ResourceTimeRangeStore } from '....';