Hello @Ian_Pee ,
Thank you for the provided demo.
Just a little clarification, of the current scenario - the issue in your demo occurs because the scheduler creates the second_scale
just by doubling the scale_height
- so if the main scale is 20px
it doubles its value to 40px
to display the second scale.
In your demo, you create the timeline view timeline
on render 1
click. In the render 2
click, you are creating the different view (timeline_2)
but resetting the scale_height
for all the scheduler(so it affects the currently displayed view (timeline1
), so it causes the current issue.
So the thing that you can do, is to:
1.) Use the view with same name but different configs for each view move:
http://snippet.dhtmlx.com/5/b17c2e1be
2.) Use the default scheduler navigation to switch views like follows:
<div class="dhx_cal_tab" name="timeline_tab" style="right:280px;"></div>
<div class="dhx_cal_tab" name="timeline2_tab" style="right:280px;"></div>
</div>
Demo (HTML/CODE tabs):
http://snippet.dhtmlx.com/5/001b50abe
3.) Create timelines at scheduler initializing, and just switching with them by custom functions:
function recreateTimeline(){
// This line fixes the scale height on each timeline create
scheduler.setCurrentView(new Date(2020, 5, 29),"timeline")
}
function recreateTimeline2(){
// This line fixes the scale height on each timeline create
scheduler.setCurrentView(new Date(2020, 5, 29),"timeline2")
}
(if you are using some framework that destroys scheduler on switching tab, you also should set the scale_height
before the scheduler.init
call).
Currently, the dev team works on a fix for this issue, unfortunately there is no ETA.