How to set height of event slot in week view

2 posts, 0 answers
  1. Arina
    Arina avatar
    2 posts
    Member since:
    Mar 2020

    Posted 17 Apr 2020 Link to this post

    I need to switch eventTemplate of week view after clicking custom button between 

    var smallEventTemplate = `<div class="k-event-template">#: title #</div>`;

    var bigEventTemplate = `
    <div class="k-event-template">
          #: kendo.toString(start, "hh:mm") # - #: kendo.toString(end, "hh:mm") #
      <h3>#: title #</h3>
      <p>#: description #</p>

    Together with that, I need to change event slot height according to size of template. The problem is I can't find how to change eventTemplate programmatically and I can't see opportunity to change event slot of week view. Can you help me with this issue, please?
  2. Petar
    Petar avatar
    470 posts

    Posted 21 Apr 2020 Link to this post

    Hello Arina,

    The event template can be changed programmatically using the approach demonstrated in this Dojo example. You have to destroy the Scheduler component and re-initialize it in order to set the new event template in the "week" view. 

    Regarding the height of the event, in the week view, it depends on the start and end hours of each event. There is the "views.eventHeight" configuration of the Scheduler that sets the height of slots/events, but it is not applicable for the "week" view. You can read more about it in the provided link to the API. 

    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top