Hi i want to know how i can customize scheduler.templates.week_unit_scale_text with some dynamic content.
Lets say i have some LIST that i want to change under date section as you can see in screen shot below.
I want to add dynamic content which could be able to update later with calendar layout… lets say if i add a table… after date… below part should be push more below… and my new table should be in the middle of date section and the 2nd section which i have made.
Plus the most important thing i need is i want to get date in below function while rendering layout.
i have to put some conditions by date wise or Day wise…
this is calendar and please not the height generated for (dhx_cal_header) by SCHEDULER’S JS is 60px as in screen shot and i have extra layout added after unit view lablel… which isn’t showing right now. You will see it next…
As you can see i have overwrite the layout for unit view by using
scheduler.templates.week_unit_scale_text
But i am unable see my layout if i don’t change the height for (dhx_cal_header) manually
Like this.
So my problem is that i should be automatically generate height for the total length of my layout.
Plus later on if one of these layout BLOCKS gets added or removed… It should become responsive in layout generating.
As you can see unknown margin coming between dates and unit view section.
Also i studied it works if i give 100 xy.scale.height that will be multiplied by the number of units i have.
I don’t want that margin.
Till now what i could find is that in ( dhtmlxscheduler_units.js) …
line number 149 e.xy.scale_height=Math.ceil(n/2),d.call(this,t,s,i,o,Math.ceil(e.xy.scale_height));
if i just fix a value for this
e.xy.scale_height=Math.ceil(n/2)
As
e.xy.scale_height=20
And the rest i use your solution in scheduler’s config as below.
I don’t understand 100% what is that in the core code.
I just need to know if i could pass this value from scheduler to your core code dynamically… NOT BY CHANGING CORE CODE?
I’m not sure that I fully understand the issue. When you set xy.scale_height=100, both lines in the week units will have height = 100px: DHTMLX Snippets
If you want to change it dynamically, you don’t need to change the source code.
Just update this value each time when you change the view in the onBeforeViewChange handler.
The demo contains Scheduler v.4.3.25. Use the template in the build of the latest version.
This is exactly my issue that appears in your snippet as well.
setting this xy.scale_height=100 is fine it should increase height of date section.
like in below screen shot.
I would like as in the picture that the height of the date section scale stays fixed standard size and Unit section area which is under the date section to have a custom size for height. As when I’m applying the fixes that you suggested . Both section are getting increased… I would only the increase height for unit section separately.
As show in the photoshopped image that i’ve linked below.