Update the value of scheduler.xy.scale_height in dynamic

Hi everyone,

Now I’m trying if I can dynamically update the size of scheduler.xy.scale_height.
My timeline view is displayed by 1 day default.

When initializing after timeline creation:

const myScheduler1 = Scheduler.getSchedulerInstance()
myScheduler1.xy.scale_height = 40
myScheduler1.init('Scheduler1', currentDate, 'timeline')
myScheduler1.parse(data1)

const myScheduler2 = Scheduler.getSchedulerInstance()
myScheduler2.init('Scheduler2', currentDate, 'timeline')
myScheduler2.parse(data2)

When updating the height size of myScheduler1:

let targetScheduler= myScheduler1.getView();
:
targetScheduler.xy = { scale_height: 20 };
:
myScheduler1.setCurrentView(currentDate, 'timeline')

I implemented like above but it has not been reflected well.
Would it has any mistakes regarding the writing way of its option xy.scale_height ?
I’m concerning if the object targetScheduler that doesn’t have xy is okay…

Thank you for your kind support in advance.

meicom

Hello @meicom,

The issue with not updated scale height occurs because the getView object doesn’t contain xy, as it’s a part of global config for scheduler(not for specific view).

If you change this code like follows:

let targetScheduler= myScheduler1;
:
targetScheduler.xy.scale_height = 20;
:
myScheduler1.setCurrentView(currentDate, 'timeline')

The issue should be fixed, here is a demo:
https://snippet.dhtmlx.com/4vqtze17

Kind regards,

1 Like

Hello Siarhei,

I got it, I would directly set the height size to myScheduler1 itself.
Thank you for sharing your kind information as always.

Best Regards,

meicom

1 Like