Changing eventHeight to auto changes height of the scheduler

4 posts, 0 answers
  1. Grant
    Grant avatar
    167 posts
    Member since:
    Jul 2016

    Posted 04 Feb Link to this post

    Hi,

    As my title says, if I change the event height to "auto" for a month view, the height of the entire scheduler changes. it shrinks and then expands depending on the events.Is it not possible for the scheduler to remain 1000px high (for eg) and just the events auto size?

    Please see my dojo (https://dojo.telerik.com/ONUcadIP) based on your docs example (https://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler/configuration/views.eventheight)

    Thanks,

    Grant

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2104 posts

    Posted 05 Feb Link to this post

    Hello Grant,

    Actually, in the example you posted the Scheduler keeps its height (1000px), see this screenshot. It is the time slots that resize based on the number of events in them. Since there is only one event in one of the slots the total height of the slots is smaller than the total height of the Scheduler. If you were to add more events the total height of the slots will increase, but up to the Scheduler's height, i.e. the specified height is respected.

    This behavior is due to the eventHeight option's "auto" value. Set like this it enables another option: adaptiveSlotHeight. This is mentioned as a note in the eventHeight api documentation.

    Regards,
    Ivan Danchev
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Grant
    Grant avatar
    167 posts
    Member since:
    Jul 2016

    Posted 05 Feb Link to this post

    Hi Ivan, 

    I understand all that, thanks. I should have been clearer in my question.

    Is it possible at all to set the the adaptiveSlotHeight=false and eventHeight=auto? That way the scheduler can fill the 1000px height, and just the events within the slots have a varying height. Or does the eventHeight being false override the adaptiveSlotHeight to true, regardless of its current value?

    Thanks, 
    Grant

  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    2104 posts

    Posted 07 Feb Link to this post

    Hi Grant,

    eventHeight="auto" is implemented to work only with adaptiveSlotHeight=true, i.e. you cannot have auto-resizing events with adaptiveSlotHeight disabled. Consider the following example: https://www.screencast.com/t/lFpHDoBft

    With eventHeight set to "auto" the event with long title "asdas..." has resized proportionally to fit the text of the title. As a result the slot has also resized to fit this event (and "Interview", which has the same date). If adaptiveSlotHeight were to remain disabled the slots would maintain their height. If that were the case how would the resized event fit within such a slot? Going back to the screenshot above imagine fitting the "asdas..." event within the height of the next slot where "test2" is. And what if you have 5 events like "asdas" on the same date? If the slot does not resize to fit them all there would be no point setting eventHeight to "auto".

    I hope this explains the need for adaptiveSlotHeigh being enabled when eventHeight is set to "auto". If you want adaptiveSlotHeight disabled, then the options are:

    1. not setting eventHeight explicitly. In this case it will use its default value (25).

    2. setting a number to eventHeight, for example: eventHeight: 100

    Regards,
    Ivan Danchev
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top