Our pure JavaScript Scheduler component


Post by loupi »

Hello,

Using SchedulerPro 6.0.5 lazy load feature.

I have about 200 resources, each with their own Calendar, where work hours are defined using CalendarIntervals. Every resource has it's own "calendar" property, which value is the id of it's calendar.

On my server, I am using the "startIndex", "count" and "stores" arguments to load the correct resources and return them only when required. (that is, the "stores" argument contains a "resources" string).

On first load, the "stores" argument also contains a "calendars" value. When it does, I also add the calendars of the resources within the range of "startIndex" and "count" to the response.
The frontend receives the response and correctly displays the first page of resources with their working hours from their calendars.

However, when I scroll down to load other resources, the server never receives a "calendars" value in its "stores" argument. It responds with the rest of the resources with their "calendar" property set.
The frontend, after receiving the response, sends a sync request which sets. the "calendar" property of the newly loaded resources to null. And from that point it looks like all the calendars of the resources that where loaded on first load are lost and not displayed.

Maybe I'm doing something wrong, do you have any guidance on how to properly lazy load calendars?
Also, would there be a way to load and merge only the required CalendarIntervals, maybe based on the displayed datetime range, a bit like lazy loading events is performed?

Regards


Post by joakim.l »

Hi

ResourceCalendars is currently not supported to lazy load. Made a ticket for us to enable that support https://github.com/bryntum/support/issues/10005

In the meantime you should be able to exclude the ResourceCalendars store from the CrudManager/ProjectModel by configuring https://bryntum.com/products/schedulerpro/docs/api/Scheduler/crud/AbstractCrudManagerMixin#config-crudStores, and handle that load separately. But, it should also work to return all ResourceCalendars in the first request as well, but it doesn't seem to work for you.

Regards
Joakim


Post by loupi »

Hello Joakim,

Thank you for the quick response. I followed your suggestion of loading all calendars at first load and it works.
I'll be using this solution until support for lazy loading is added to calendar store.

Regards


Post Reply