Event onXLE fires 2 times and my items get duplicated...

Hi,

when i use calendar to navegate to other days i get my items duplicated, i put a console.log in “onXLE” event and i saw when i change day this event is fired 2 times i dont know why.

my event onXLE dont modify my elements on scheduler, but i put this code too in event and i get interesting things:

var minDate = scheduler.getState().min_date;
var maxDate = scheduler.getState().max_date;
var evs = scheduler.getEvents(minDate,maxDate);
console.log(evs.length);

The first time evs.lenght gives me 630 but the second time gives me 1258…

The information that comes to me using “scheduler.load (url, ‘json’)” is not duplicated :blush:

Please help

Hi,

If you are using dynamic loading in the Scheduler, the component can load data not only for the visible month but for the next month as well, that is why the length of evs collection is bigger than expected.
The length of evs.length collection doesn’t matter while the actual rendering shows the correct state of events.

Hi,

The problem is actual rendering not shows the correct state of events.

I have seen that when I change from day to other day using the calendar the events onViewChange and onXLE are fired 2 times each one…
i put console.logs in events code and i get the message in diferents orders! thats the problem i think…

sometimes events are fired like:
onViewChange-> onXLE -> onViewChange->onXLE and my scheduler items are not duplicated but if i get:
onViewChange -> onViewChange -> onXLE -> onXLE my items get duplicated…

I really do not think the problem is the events since they do not modify the items but it can be a clue…

im really stuck with this problem…