Our pure JavaScript Scheduler component


Post by pjerome »

Hello,

any idea how to counter the following:
We create an event in the scheduler. This works fine and the event is displayed.
The 'createurl' is called as defined in the eventStore, the server responds with a new id and the event is still displayed. The client-side eventStore is updated, too. So far so good.

But: In the DOM the first event with the auto-id / phantom-id still exists. And it exists exactly over the newly created event with the new database-generated id.

Effect: the new event can't be edited or dragged, because the old event catches the mouse.

This never happens after the scheduler has been open for a few minutes, but only in the first let's say 2-4 Minutes after loading. Is there a timeout in the background that prevents the garbage collection?

As soon as the timeaxis has been redrawn the new event moves to the foreground and the old event has been deleted from the DOM as it should have been from the start.

Any ideas?
I am a bit stuck with this. Thanks!

Post by mats »

Which scheduler version are you using? And how can we reproduce this?

Post by pjerome »

Hi Mats,
thanks for your quick reply.
Scheduler Version is 1.2.2

I unfortunately have no way to give you an example to reproduce it, as I can reproduce it only sometimes, only after a reload of the scheduler and only in the complete context. I can not give you access to the whole project as it is only accessible in our intranet.

What I can tell you is that everything works fine, only the <div> containing the phantom event is *sometimes* not deleted . The data-event-id="_generated..." tag is actually removed from the phantom <div> but the id="schedule-_generated...." part remains and the <div> itself of course.

I could not find any regularity to this.

What helped so far is a very dirty workaround in the commitAdded-event of the eventStore:
		listeners: {
        commitAdded: {
            fn: function(source) {
               
                // delete phantom events if there is any
                var el = document.querySelector('[id^="schedule-_generated"]');
                if ( el ) el.remove();
            }
        }

    }
If you can point me in any direction for further understading, I'd be grateful.
Regards
Philipp

Post by mats »

Could you please try using latest version and see if that fixes it?

Post Reply