I followed the guide below and successfully ported it to use my own database to work. Everything works perfectly.
http://www.codeproject.com/Articles/249921/How-to-Build-a-Room-Booking-Calendar-with-dhtmlxSc
However, after including the collision extension to the project, a few errors occur even though it can prevent collision properly on future events.
First, in Agenda, Week, and Month view, if I double click on a date before today’s date attempting to create an event (which is not allowed as stated in the above tutorial), FireBug shows that “a is undefined” in
if (a.rec_type) {
on line 16 of dhtmlxscheduler_collision.js. Then, any further single clicks on anywhere of the page will trigger the same error. Moving the cursor from a day/time grid to another day/time grid will trigger another error “ev is undefined” in
start = ev.start_date.valueOf();
on line 1959 of dhtmlxscheduler.js. Double clicking to create an event on or after today’s date in these 3 views will stop the errors, but double clicking on a date before today’s date to create an event is will trigger the errors again.
Second, in Units view, the error from dhtmlxscheduler_collision.js also occurs with the same action. Yet, moving the cursor will trigger a different error “c is undefined” in
c[a.map_to] = a.options[e].key;
on line 125 of dhtmlxscheduler_units.js. Also, Double clicking on or after today’s date in this view cannot create an event or stop the error, but I’m able to switch to other 3 views and double click to create an event on or after today’s date and that stops the errors. Double clicking on a date before today’s date to create an event is will trigger the errors again.
Third, in any view, if “a is undefined” is triggered, the drag and drop function will not work. All events (no matter they are past or future events) cannot even be dragged.
I think that in these 3 errors, the similarity is that the js is trying to get an event object from an empty grid, which is not logical as a blank grid does not have any event on it. It also seems to treat the double click as a drag_mode of “move”.
I don’t have any idea to fix these.