Our pure JavaScript Scheduler component


Post by v-paulrausch »

I think I've identified a bug with the Scheduler Pro, there seems to be an issue with the Scheduler Pro where events won't show till you resize the browser or take some other action on the scheduler(the events exist in the eventstores). I've attached two identical example apps one with Scheduler one with Scheduler Pro, it works with the original Scheduler but not with 'Pro'. Both examples are built off the get started guide but I added the mock API call, both will work if you go back to the project autoload feature. We need support loading events from a 3rd party backend and don't have a direct API call for the autoload feature.

This is kind of critical as we need a way for this to work or a work around.

Thanks,

Paul

Both work as expcted if you go back to this data load method.

   // project : {
    //     autoLoad  : true,
    //     transport : {
    //         load : {
    //             url : 'data.json'
    //         }
    //     }
    // }
Attachments
Stores.JPG
Stores.JPG (88.77 KiB) Viewed 515 times
DemoReactSchedulerPro.zip
(1.13 MiB) Downloaded 18 times
DemoReactScheduler.zip
(1.48 MiB) Downloaded 19 times

Post by anoop.francis »

Hi, I got the same issue in our product where we are using Scheduler Pro
Image

But it does not happen all the time, Our client reports that in random cases no bookings get displayed in Scheduler.
We think it might be in cases when the Scheduler stays open for a long time (a day, or two) and then user starts using the tool again.


Post by johan.isaksson »

Hi,

@v-paulrausch, I'll see if I can reproduce it and get back to you.

@anoop.francis, that sounds like a different issue. Please open a separate thread on that

Best regards,
Johan Isaksson

Post by johan.isaksson »

I can confirm that SchedulerPro does not handle single assignment well when passed already instantiated records. Have opened a ticket here https://github.com/bryntum/support/issues/8430

To work around it until it is fixed, could you pass raw data objects instead? Unless you are doing some advanced preprocessing, that should reduce your code also, and let you improve performance (allows configuring stores with useRawData to not clone incoming data).

Alternatively, pass assignments also.

Best regards,
Johan Isaksson

Post by v-paulrausch »

Johan and Team,

I've included both setting of assignments and using the project model and both react the same way, it doesn't work unless you resize the browser window.

Our scenario is simple. We are in a pretty big crunch as we were working with Scheduler for POC and licensed the Pro version which isn't working the same way so if you can help me get pointed in right direction with below scenario it would be huge.

React App
1) Need to load data from an API we have no control over
2)Map that end point data into Brytnum models
3)Display data on the calenar.

Attachments
DeomReactSchedulerProProject.zip
(1.13 MiB) Downloaded 14 times
DemoReactSchedulerProAssignments.zip
(1.13 MiB) Downloaded 19 times

Post by v-paulrausch »

I was able to find a way to make it work with the code below. Not sure if this will cause other other issues but seems to work to render the initial events.


const App: FunctionComponent = () => {

const schedulerpro = useRef<BryntumSchedulerPro>(null);  
  
useEffect(() => {
  const fetchData = async () => 
  {
    const schedService = new SchedulerService();
    const response = await schedService.GetData();
  
    schedulerpro.current?.instance.suspendRefresh();

    if(schedulerpro.current){
      
      
      let project = new ProjectModel(
        {
              assignmentStore : {
                  data       : response.assignments
              },
              resourceStore : {
                  data       : response.resources
              },
              eventStore : {
                  data       : response.events
              }
            }
      );
      
      schedulerpro.current.instance.project = project;
      //schedulerpro.current.instance.endDate = new Date(2022, 2, 23, 18);

    }
    
    schedulerpro.current?.instance.resumeRefresh(true);
    await schedulerpro.current?.instance.project.commitAsync();
  }

  fetchData();
}, []);

return (
  <Fragment>

    <BryntumSchedulerPro
        ref = {schedulerpro}
        {...schedulerproConfig}
        startDate = {new Date(2022, 2, 23, 2)}
        endDate ={new Date(2022, 2, 23, 18)}
    />
  </Fragment>

);
};

Post by marcio »

Hey Paul,

Thanks for sharing the updates and glad that you figured out a workaround!

Best regards,
Márcio


Post by v-paulrausch »

Curious how others are handling it this must be a pretty common scenario.


Post by johan.isaksson »

Hi Paul,

Having revisited your testcase, I see that the fail vector I first found was not the real cause. Will look into it further on Monday, what you are doing in the app should work without needing a forced refresh. Ticket to track my progress on that: https://github.com/bryntum/support/issues/8454

Best regards,
Johan Isaksson

Post Reply