We upgraded from Bryntum 5.1.0 to 5.2.0 and since the upgrade (we are now on the latest 5.2.3) we are having an issue with the display of our TimeRanges.
We load the time ranges from our server and set it inside of our componentDidMount as follows:
The Scheduler used to display them on page load, but now it only displays a few of them until the user interacts with the page or waits for around 10 seconds, then the TimeRanges suddenly show up.
We managed to get them showing on load by adding this hack right after setting them in the store
Could you please share the code of your component and timeRanges data example.
We actually use useEffect for these things, but it should be ok for both.
Please also try this way to set data:
Could you please share the code of your component and timeRanges data example.
We actually use useEffect for these things, but it should be ok for both.
Please also try this way to set data:
No need to do that, it will be automatically created, you just need to use that (get a link for the instance). Please have a look in our React examples. Something like that
I think without the full code there was a misunderstanding
BryntumScheduler
is actually our own component and not imported from Bryntum. We dont current use any of the wrappers.
We will look into whether our code can be adapted to use the provided React wrappers and get back to this thread if we are unable to use the wrappers or have questions.
We updated our code to use the react wrapper (as well as the react scheduler npm package). We got it to render great on initial load (even with removing the hack we originally logged this ticket for). However, everytime we do anything with an event, all the events and the date/time headers disappear. The scheduler then goes into a state where we cannot do anything except scroll. If we try to schedule by dragging for example, we get errors like this one:
Uncaught TypeError: Cannot read properties of undefined (reading 'onCellClick')
at Scheduler.triggerCellMouseEvent (GridElementEvents.js:310:1)
at Scheduler.onElementClick (GridElementEvents.js:403:1)
at Scheduler.onElementClick (TimelineDomEvents.js:319:1)
at functionChainRunner (InstancePlugin.js:44:1)
at plugInto.<computed> [as onElementClick] (InstancePlugin.js:332:1)
at Scheduler.onHandleElementClick (GridElementEvents.js:389:1)
at Scheduler.handleEvent (GridElementEvents.js:228:1)
at HTMLDivElement.handler (EventHelper.js:470:1)
When things change we update the event store directly (after a rerender) but we also tried not doing that and just sending the time ranges and events into the BryntumScheduler.
We are now getting the scheduler instance by using the ref as suggested. Sometimes the events reappear when scrolling but not always.
Im not sure if that will be possible, we have a lot of customization in our application, right now we are just trying to get to where we are using it correctly as well as getting rid of checking in the compiled code (umd module i believe). We can attempt to create an example, but we work with data from a graphql backend so setting up an example might take a bit long.
Alternatively is there any other piece of code that i can send to help?