Premium support for our pure JavaScript UI components


Post by plus »

I load my event store without auotload property.
When I make a change and press a button to save, if I look the values of eventStore.changes, I have all my data in "added" array.
In this condition, if I update or remove an event, this data is not present in modified or removed array.
Which is the problem?

If I call clearChanges() after loaded, I have "added", "modified" and "removed" arrays empty

In this way when I add or remove an event, I have one element in the "added" or "removed" array
A strange behaviour is that if i update an event in "modified" array I have all the events

What I have to do to have right infromation about added, modified and removed events?
This is important for me to have information of what I have to save/change on database

Thabk you for your help
best regards


Post by mats »

Likely you have not set an 'id' for your records, meaning we treat them all as new.


Post by plus »

I checked my code and I verified that i put a value on id property. Could be another reasons that cause this problem?


Post by mats »

Probably not, please provide a test and we'll look into it.


Post by plus »

Now i can produce a demo
this is part of my code

  let pianificazioneResource = {
            id: pianificazione.Task.IdTask + Math.random(),//<--here I set value to id
            resourceId: risorsaResource.id,
            idPianificazione: pianificazione.IdPianificazione,
            idTask: pianificazione.Task.IdTask,
            startDate: pianificazione.Dalle,
            endDate: pianificazione.Alle,
            //duration: pianificazione.Alle.getTime() - pianificazione.Alle.getTime(),
            name:
              pianificazione.Task.IdTask == ''
                ? pianificazione.Task.Descrizione
                : this.buildTestoPianificazione(pianificazione),
            cliente: pianificazione.Task.ClienteRichiedente.RagioneSociale,
            milestoneWidth: 0,
            eventColor: pianificazione.Task.IdTask.startsWith('Milestone')
              ? 'black'
              : pianificazione.TipoDato != 1
              ? 'red'
              : pianificazione.Task.StatoTask.Colore,
            //durataStimata: pianificazione.Task.DurataStimata,
            versioneTask: pianificazione.Task.VersioneTask
              ? pianificazione.Task.VersioneTask.IdVersione
              : '',
            descrizioneStatoTask:
              pianificazione.Task.StatoTask.DescrizioneStatoTask,
            datiPianificazione: pianificazioneSchedulerViewModel,
            tipoDato: pianificazione.TipoDato,
            eventStyle: pianificazione.TipoDato == 1 ? 'plain' : 'line', //https://bryntum.com/examples/scheduler/eventstyles/data/data.json
            draggable: pianificazione.TipoDato == 1 ? true : false,
            resizable: pianificazione.TipoDato == 1 ? true : false,
            note:
              pianificazione.TipoDato == 1
                ? pianificazione.Task.IdTask == ''
                  ? pianificazione.Note
                  : 'Descrizione task: ' + pianificazione.Task.Descrizione
                : '',
          };
          resourcesEvents.push(pianificazioneResource);

      // this.resourcesScheduler.eventStore.add(pianificazioneResource);
    });

    this.resourcesScheduler.eventStore.add(resourcesEvents); //<-- here i add events to eventStore
  });

Post by mats »

Sorry, we need a runnable test case. Please change the code of one of our demos to reproduce your problem, then zip it up and upload it here.


Post Reply