search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

events.update updates the whole calendar and not the only event, causing flickering.

Asked by Anonymous
8 months ago.
      const id = pickedEvent !== undefined ? : "-1";
        let event = calendarRef.current!;
        // console.log("E' QUI CHE DIVENTA 1");

        if (event !== null) {
          const clientId = event?.data.tag.client_id;
          // console.log("[DAYPILOT] UPDATE");

          // console.log("NOTE", note);

            id: id,

            text: pickedService[0].service.id_service,
            start: pickedService[0].date!["start"],
            end: pickedService[0].date!["end"],
            resource: pickedService[0],
            cssClass: "draft_event",
            barHidden: true,
            tag: {
              marker: pickedService[0].service.ec_color_light,
                ( ?? "Passaggio ") +
                " " +
                (watchFields.surname ?? gender),
              service: pickedService[0],
              writtenNote: note,
              note: note !== undefined,

Why this code causes flickering in all the calendar when called? I would like only the event to be updated, but everything is redrawn.

Answer posted by Dan Letecky [DayPilot]
8 months ago.

There was an issue with events.update() when called with a raw data object as an argument. It should be fixed now in the latest sandbox build (2023.4.5743). It caused the calendar to update the events twice.

See also:

Now the performance should be comparable to the update that is performed when an event is dropped at a new location.

All events are always updated when calling events.update(). Since the viewport is limited this shouldn’t cause any flicker. Further optimizations would only be possible for cases when the event position (start, end, resource) doesn’t change.

Please let me know if the problem persists.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.