This is a migrated thread and some comments may be shown as answers.

How to set height of event slot in week view

1 Answer 660 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Arina
Top achievements
Rank 1
Arina asked on 17 Apr 2020, 11:51 AM

Hello
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">
  <p>
      #: kendo.toString(start, "hh:mm") # - #: kendo.toString(end, "hh:mm") #
  </p>
  <h3>#: title #</h3>
  <p>#: description #</p>
</div>`;

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?

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 21 Apr 2020, 08:59 AM

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. 

Regards,
Petar
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.
Tags
Scheduler
Asked by
Arina
Top achievements
Rank 1
Answers by
Petar
Telerik team
Share this question
or