Remove the Time rows in the Day view

5 posts, 0 answers
  1. Edward
    Edward avatar
    29 posts
    Member since:
    Aug 2014

    Posted 06 Nov 2014 Link to this post

    My tasks are going to be all day tasks only.  The All Day row has several tasks in it but they are bunched up.  I need to remove the time rows in the Day view.

    I've tried this as a databound event:

    function scheduler_dataBound(e) {
        var scheduler = this;
     
        var ele = scheduler.wrapper.find(".k-scheduler-layout>tbody>tr:nth-child(2)");
        ele.remove();
        if (!isResizedManually) {
            isResizedManually = true;
            scheduler.view().refreshLayout();
            $(window).trigger("resize");
        } else {
            isResizedManually = false;
        }
    }

    This gets rid of the time rows but the all day row is still the same height.  Another problem with this is that it removes the time rows for all views: Month, Week, Day, etc...  I only want them removed for Day.

    How can I get this to work?


  2. Edward
    Edward avatar
    29 posts
    Member since:
    Aug 2014

    Posted 07 Nov 2014 in reply to Edward Link to this post

    I forgot to say I'm using:

    .AllDayEventTemplate(
                "<div class='asset-task' style='color: black; background-color: #= Color #' title='#= title # \nAsset: #= AssetName # \nOwner: #= OwnerName #'>" +
                    "<strong>#= title #</strong>" +
                    "<p>" +
                        "<strong>Asset: </strong>#= AssetName #" +
                        "<br>" +
                        "<strong>Owner: </strong>#= OwnerName #" +
                    "</p>" +
                "</div>"
            )
        .EventTemplate(
                "<div class='asset-task' style='display: inline-block; color: black; background-color: #= Color #' title='#= title # \nAsset: #= AssetName # \nOwner: #= OwnerName #'>" +
                "<strong>#= title #</strong>" +
                "<p>" +
                    "<strong>Asset: </strong>#= AssetName #" +
                    "<br>" +
                    "<strong>Owner: </strong>#= OwnerName #" +
                "</p>" +
            "</div>"
        )

  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 10 Nov 2014 Link to this post

    Hello Matt,

    You can use the view() method of the scheduler to determine the current view and execute the code only when it is day view:

              if (scheduler.view().title == "Day") {

    Here is how to set the height of the all day slot:

    scheduler.wrapper.find(".k-scheduler-header-all-day tr").height(100);
    scheduler.wrapper.find(".k-scheduler-times-all-day").parent().height(100);

    Finally here is a live demo which shows both:

    http://dojo.telerik.com/@korchev/uDozu

    Regards,
    Atanas Korchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Edward
    Edward avatar
    29 posts
    Member since:
    Aug 2014

    Posted 17 Nov 2014 in reply to Atanas Korchev Link to this post

    Atanas,

    Thanks for your reply.  I got it working using your example.  I did notice that if you add several events while on the day view, the day view does not expand to display all of the events even though there is room.  Please see the example you posted. 

    How can you have the day view display all events after adding on to the day view?
  6. Edward
    Edward avatar
    29 posts
    Member since:
    Aug 2014

    Posted 18 Nov 2014 in reply to Edward Link to this post

    I have this working. Please ignore last.

    Thank you,
Back to Top
UI for ASP.NET MVC is VS 2017 Ready