In some cases we need to call createTimelineView() more than once. For example, several applications in one project, which are not related to each other, and they require timeline view.
But UI begins to run slower with a few calls createTimelineView (http://forum.dhtmlx.com/viewtopic.php?f=6&t=15951)
Due to the code
scheduler.attachEvent("onOptionsLoad", function() {
O.order = {};
for (var P = 0; P < O.y_unit.length; P++) {
O.order[O.y_unit[P].key] = P
}
if (O.name == scheduler._mode) {
if (scheduler._date) {
scheduler.setCurrentView(scheduler._date, scheduler._mode)
}
}
});
Namely, setCurrentView calls the event “onViewChange” and each new challenge createTimelineView event onViewChange happening more and more number of times.
As an option, following workaround:
scheduler.attachEvent("onOptionsLoad", function() {
O.order = {};
for (var P = 0; P < O.y_unit.length; P++) {
O.order[O.y_unit[P].key] = P
}
if (O.name == scheduler._mode) {
if (scheduler._date) {
// scheduler.setCurrentView(scheduler._date, scheduler._mode)
}
}
});
that is comment row
scheduler.setCurrentView(scheduler._date, scheduler._mode)
and after that call
scheduler.callEvent("onOptionsLoad", []);
scheduler.setCurrentView(scheduler.getState().date, scheduler.getState().mode);
instead of
scheduler.callEvent("onOptionsLoad", [])
where it is needed.
The same problem and workaround as about createUnitsView or joint use createTimelineView and createUnitsView.
Is there better workaround for this problem?