Search code examples
kendo-uitelerikkendo-asp.net-mvckendo-schedulertelerik-scheduler

Telerik Kendo Scheduler: Show all day event in the main part of Week View


I am trying to figure out how can i hide AllDaySlot, but still see events in the main part.

I've checked https://www.telerik.com/forums/=-24-hour-events-treated-as-all-day topic and any related topics but found no solution.

I can see working example, but for AJAX here: https://demos.telerik.com/aspnet-ajax/scheduler/examples/day-week-multi-day-views/defaultcs.aspx , but i had no luck to find out why and how is it done.

This functionality is required by my client and it's critical.

Looking forward for your answers.

Thank you.


Solution

  • The Kendo UI scheduler ignores events > 24h in the main part. See this feature request. Vote for it. Maybe Progress will fix this at some point in time.

    For the time they don't I created a custom view.

    Basically I inherited from kendo.scheduler.dayview.js, replaced the internal _renderEvents function.

    Starting point for me was changing _renderEvents

    var isMultiDayEvent = event.isAllDay || event.duration() >= MS_PER_DAY;
    

    to:

    var isMultiDayEvent = event.isAllDay;
    

    And

    ranges = group.slotRanges(event);
    

    to

    ranges = group.slotRanges(event, false);
    

    In _updateResizeHint and _updateMoveHint I replaced

    var multiday = event.isMultiDay();
    

    with

    var multiday = event.isMultiDay() && this.options.allDaySlot;
    

    Which prevents the view from interpreting events > 24h from being treated as all day events.

    What happens next heavily depends on your configuration (grouping, tooltips, custom templates, resizing, editing ...). Maybe you get errors at places my version never saw.

    If you experience errors, let me know about it and you fixed it (or not :) ). Most probably others here are interested too.

    HTH

    Bernd