search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Setting eventheight dynamicly makes cells too large when expanding group overlapping

Asked by Adam
5 years ago.

Hello.
When I set the eventHeight dynamically by doing:
dp.eventHeight = 25;
dp.rowMinHeight = 50;
dp.rowMarginBottom = 5;
dp.rowMarginTop = 5;
dp.update();

then as seen in the picture, when I click the grouped overlapping events, the margins are calculated wrongly and are in the thousands of pixels. A practial example would be when doing eventHeight 50 and expanding the grouped events, then the height of the div 5060.
It seems like it does not reset the event height or that it duplicates so 5060 is actually 50(height)60(height+5margintop+5marginbottom).
When I set the eventHeight to be 25px and the rowMinHeight to be 50px, the actual height is: 2535px.
When I set the eventHeight to be 40px and the rowMinHeight to be 80px the actual height is: 4050px
I could be wrong however, but the bug is there. When I don't load the height dynamically all is fine.
The bug is consistent and happens when expanding group overlapping or if I have groupConcurrentEvents set to false.

I am using the latest version of DayPilot

Comment posted by Dan Letecky [DayPilot]
5 years ago.

I've tried to reproduce the problem by running your update code at this page:
https://javascript.daypilot.org/demo/scheduler/groupconcurrent.html

However, it seems to work fine.

Are you able to reproduce the problem there?

Something like you describe could happen if one of the numbers were specified as text, e.g. dp.eventHeight = "25";

Answer posted by Adam
5 years ago.

I was grabbing the value from a dropdown and did not run it through parseInt. That solved the problem - sorry for the trouble :-)

Comment posted by Dan Letecky [DayPilot]
5 years ago.

Great, thanks for the update!

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.