Our pure JavaScript Scheduler component


Post by support@bright »

We’ve stumbled upon 20-30 sec browser page freezing in Bryntum Scheduler PRO 1.0.2

We upload the data (about 1000 events): currentEventStore.data = data using beginBatch and endBatch

If we do

[code]currentEventStore.beginBatch();
currentEventStore.data = data;
currentEventStore.endBatch();[/code]

we still get ‘update’ event for each record


If we don't use endBatch()

[code]currentEventStore.beginBatch();
currentEventStore.data = data;[/code]

Everything works fine, we don't get ‘update’ event for each record, but we have to close batch

Using setTimeout doesn't help

[code]currentEventStore.beginBatch();
currentEventStore.data = data`;
setTimeout(() => {
    currentEventStore.endBatch();
}, 0)[/code]

Apparently there are async operations during the adding records to currentEventStore, so endBatch called earlier

currentEventStore.add(data, true)

silent doesn't work as well

Best,
Alex


Post by johan.isaksson »

Hi,

There is an issue with assigning new datasets to stores in Scheduler Pro and Gantt. It first empties the stores, removing records from engine. Which takes way longer than it should.

As a workaround, I would recommend trying to replace the entire project instead of repopulating the stores. Might help with the performance. Something similar to:

scheduler.project = new ProjectModel({
   eventsData : data
};

Have opened a ticket on this: https://github.com/bryntum/support/issues/1470

Best regards,
Johan Isaksson

Post by support@bright »

Hi Johan,

Unfortunately, it didn't work out.
Could you please give the approximate time for solving the issue?

Best,
Alex


Post by johan.isaksson »

Hi again,

I dare not say, but I am looking into it. If you track the ticket you will see when it progresses. Also there is a beta out of next major version of Scheduler Pro (4.0.0 to bring versions inline between products). If you have the time you could try the new Project() approach suggested above with it, it should improve things. Available in CustomerZone

Best regards,
Johan Isaksson

Post by support@bright »

Hi

In all browsers except Safari on Mac
Beta didn’t solve the issue. Our initial approach currentEventStore.data doesn’t work. It’s even slower now.
Using batch doesn’t help as well

In Safari on Mac it seems to work well (fast)

new Project() approach is in progress

Best,
Alex


Post by johan.isaksson »

Hi,

Yes I have tried it on the beta also and it only helps with the new Project() approach. Investigating what could be done,

Is the new dataset you are applying an update of the old? If so you could try configuring your store with syncDataOnLoad: true. It will then add/remove/update the records in the store instead of replacing the entire dataset, which should be quicker.

Best regards,
Johan Isaksson

Post by support@bright »

Hi,

We are talking about the initial data loading
This is my Scheduler’s config:

      [code]resourceStore: {
        modelClass: EquipmentResourceByTeamModel,
        fields: ['color', 'title'],
        tree: true,
      },
      eventStore: {
        modelClass: JobSchedule,
      },[/code]

And probably I can’t pass it properly to new ProjectModel

That doesn’t work

currentScheduler.project = new ProjectModel({
          eventsData: data,
          resourcesData: teams,
          eventModelClass: JobSchedule,
          resourceModelClass: EquipmentResourceByTeamModel,
    });

And that doesn’t work

currentScheduler.project = new ProjectModel({
          eventsData: data,
          resourcesData: teams,
          resourceStore: {
            modelClass: EquipmentResourceByTeamModel,
            fields: ['color', 'title'],
            tree: true,
          },
          eventStore: {
            modelClass: JobSchedule,
          },
        }); 

Do you have any ideas what I do wrong?

syncDataOnLoad: true doesn’t seem to help. But as I said above it’s initial data loading.

Best,
Alex


Post by johan.isaksson »

Hi,

Ah, I did not get that it was an initial load. Then you are correct that syncDataOnLoad wont help at all.

Your new Project() code looks correct to me. Sounds as if there must be something else wrong. Could you share your dataset and relevant parts of your custom models? I could then try it here and see whats wrong

Best regards,
Johan Isaksson

Post by support@bright »

Hi

I am not able to render the tree in the resource panel using new ProjectModel. I tried to set childrenField explicitly and use the default value (use “children”property in the model). That doesn’t work. Consequently, I am not able to match events to resources. I get “Unknown identifier” for children nodes. Could you please check it on your tree example and if it is ok I will gather and share all my models.

Best,
Alex


Post by support@bright »

There is no “Unknown identifier” error in 1.0.2 but the tree is not rendered as well

Best,
Alex


Post Reply