Performance when adding large number of events via backbone

We have discovered an odd issue in DHTMLX Scheduler when using backbone and adding a very large number of events (several hundred). Imagine the events are all in the date range of Jan-Mar. If the user is currently viewing that date range, then the code that adds the events takes about 15 seconds to run. However, if the user is viewing, say, Mar-May, then the same section of code runs instantly. Not only that, but after the code has run instantly, you can immediately scroll to the Jan-Mar range and see all 200 events; they render is less than a second.

We are thinking the problem must be something like a full repaint being done by Scheduler after each event is added. For now, we have added the workaround that we change the date of the user’s view to something in the far distant future, add all the events, and then change their date back to what they had. However, this seems like a hack and we would rather have an option like “scheduler.config.suppress_repaint” that we can set to “true” while adding the events.

Does anything like this exist? If we were adding events with “addEvent”, we could simply use “parse” instead to attain better performance. But for backbone, we have not been able to find any mention of such a thing in the Scheduler documentation. Any help much appreciated.

Please try to update dhtmlxscheduler_mvc.js with the attached one, it must cause a single repaint for any number of event adding. The same fix will be included in the next official version as well. (849 Bytes)

This worked perfectly. Issue resolved. Thank you.