Discuss anything related to web development but no technical support questions


Post by tasnim »

Hi there,

Use the async APIs and ensure the incoming dataset has stable IDs (and assignments if you use AssignmentStore). Best options:

  • Replace the store atomically with loadDataAsync (preferred):

      const newEvents = await fetch('/api/events').then(r => r.json());
      await scheduler.eventStore.loadDataAsync(newEvents); // replaces and triggers calculations
  • Or set .data and wait for project to finish:

      scheduler.eventStore.data = newEvents;
      await scheduler.project.commitAsync();

If you get duplicates, check that your server either:

  • returns the same ids for existing events so they are updated, or
  • you explicitly remove before loading:
    scheduler.eventStore.removeAll(); await scheduler.project.commitAsync();
    then loadDataAsync(...).

If you use assignments / multi‑assignment update the AssignmentStore as well (or use CrudManager load/sync). See EventStoreMixin.loadDataAsync and the data property for details:

Best regards,
Tasnim

How to ask for help? Please read our Support Policy


Post Reply