Next Month Bug

When I load a calendar page, I sometimes get random Javascript errors. For example, if I click on the right button to go the next month and then try to insert a new event, I get an error:

this._colsS.heights is undefined

Also, any time I try to customize the event_text property, I get an error that says:

scheduler.templates is undefined

If it wasn’t for these errors, everything would work great, but for now I cannot customize the templates or insert dates on anything except the current month.

I have been testing it and the next month bug is not present if I first insert a new event on the current month and then change months. Everything then works fine.

scheduler.templates is undefined
It may occur if you are making some operations with events BEFORE grid.init
Be sure to exec all api calls ( except of configuration ) AFTER grid.init

this._colsS.heights is undefined
Try to updated dhtmlxscheduler.js with attached one. ( there was a known error with similar error message , which can occur in some rare cases )
dhtmlxscheduler.zip (27.8 KB)