Our pure JavaScript Scheduler component


Post by e.berktas »

Hi,

We just add to event store data as below

event = { id:.. , ...};
scheduler.eventStore.add(event);

But if we add about 5000 events like this way, we got a very bad performance.

How can we add in bulk way?

Like, events is a array of event objects,

scheduler.eventStore.data = events 

or something like this.

Thanks


Post by marcio »

Hey,

You can check the big dataset example https://www.bryntum.com/examples/scheduler-pro/bigdataset/ and use a similar approach

// Adding a mask to show a nice loading message
const mask                  = WidgetHelper.mask(scheduler.element, 'Loading records');

scheduler.suspendRefresh();
// Here you set the store to use the 5000 events array
scheduler.project.eventStore = {
    useRawData : true,
    data       : events
};

scheduler.resumeRefresh(true);
// await for the one refresh with all the new records
await scheduler.project.await('refresh');

mask.close();

https://www.bryntum.com/docs/scheduler-pro/api/Scheduler/view/SchedulerBase#function-suspendRefresh
https://www.bryntum.com/docs/scheduler-pro/api/Scheduler/view/SchedulerBase#function-resumeRefresh
https://www.bryntum.com/docs/scheduler-pro/api/SchedulerPro/data/EventStore
https://www.bryntum.com/docs/scheduler-pro/api/SchedulerPro/data/EventStore#config-useRawData

Best regards,
Márcio


Post Reply