Hello all,
I am using the Units view of the Scheduler application, version 4.2.0, and am having an issue with event collisions. I have the below code attached to the event collision event:
scheduler.attachEvent("onEventCollision", function (ev, evs){
alert("Note: There is already an appointment scheduled for that time");
return true;
});
This works fine. When there is an event collision, the alert is displayed, and the colliding event is deleted. However, when I try to add another new event after this collision is detected, I receive an error in the JS console stating “Uncaught TypeError: Cannot read property ‘!nativeeditor_status’ of undefined”, and the new event I am trying to add is not added. Note this happens even when the new event does not collide with any other events.
In looking at the database log, when the colliding event is deleted, the DELETE query is using the sid as the id. See below for example:
DELETE FROM Appointment WHERE id=‘1437066160230’
In my database, there is no record in the Appointment table with id=‘1437066160230’, since the id has yet to be converted into a tid (the actual id in the database table). This is not causing any errors on the database side, since deleting a row with an id which does not exist just results in a query with 0 rows affected. But my thought is that this might be messing up the value of !nativeeditor_status, but I could be wrong.
Is there a way to check for an event collision prior to calling addEvent() ? I.E only call addEvent() if the event to be added does not collide with an existing event. Also, maybe allow the tid to be created, and then run the DELETE query using this id instead?
This is one of my last bugs before going to Production, so any help or guidance on this would be much appreciated. Thank you!