Set isAllDay as ressource

6 posts, 0 answers
  1. Julien
    Julien avatar
    10 posts
    Member since:
    Apr 2017

    Posted 04 May 2017 Link to this post

    Hello,

    I try to color "isAllDay" event.
    The simpliest way for me to do somethiong like this:

    // Couleur isAllDay
    r.Add(m => m.IsAllDay)
    .Title("Supprimé")
    .DataTextField("Text")
    .DataValueField("Value")
    .DataColorField("Color")
    .BindTo(new[] {
                    new { Text = "Journée", Value = 1 , Color = "red" },
    });

     

    But it's not working. I also tried Convert.ToBoolean(1), but it the same issues.

    Do you have any advice ?

    Thank you

  2. Plamen
    Admin
    Plamen avatar
    3078 posts

    Posted 08 May 2017 Link to this post

    Hello,

    One way to achieve similar behavior is to use the dataBound event of the widget and change the color of the allday events as for example it is done here.

    Regards,
    Plamen
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Simon
    Simon avatar
    42 posts
    Member since:
    Mar 2016

    Posted 28 Feb 2018 Link to this post

    Hi, reopening an old post here, I tried the sample code for setting the background color of the event on dataBound event but in a recurring event only the first event in the occurrence is set to red background.Each event has a unique id, is this an issue with recurring events? Is there a workaround?

     

        function scheduler_dataBound(e) {
            //Handle the dataBound event.


                var view = this.view();
                var events = this.dataSource.view();
                var eventElement;
                var event;

                for (var idx = 0, length = events.length; idx < length; idx++) {
                    event = events[idx];

                    //get event element
                    eventElement = view.element.find("[data-uid=" + event.uid + "]");

                    //if (event.IsPublished) {
                    //    eventElement.css("background-color", "green");
                    //}
                    //else {
                    //    //set the backgroud of the element
                    //    eventElement.css("background-color", "red");
                    //}

                    eventElement.css("background-color", "red");

                }

       }

  4. Plamen
    Admin
    Plamen avatar
    3078 posts

    Posted 02 Mar 2018 Link to this post

    Hello,

    In such case we may use the dataItems instead of the events as for example in this dojo.

    Regards,
    Plamen
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. Simon
    Simon avatar
    42 posts
    Member since:
    Mar 2016

    Posted 02 Mar 2018 in reply to Plamen Link to this post

    I don't understand your response - this code doesn't change the background of any cell to red.
  6. Plamen
    Admin
    Plamen avatar
    3078 posts

    Posted 05 Mar 2018 Link to this post

    Hi,

    It seems like I have changed the dojo in the last minute before sending it - please excuse me for that. Here is a runnable dojo that worked correctly at my side

    Regards,
    Plamen
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top