Schedule event color

I'm trying to change the color of the entire event but I can not get it to work.

Pretty sure I'm missing something obvious.

See this small quick example

Only the the text background is changed.

https://stackblitz.com/edit/otywyh?file=index.js


3 Replies 1 reply marked as answer

RM Ruksar Moosa Sait Syncfusion Team April 28, 2022 11:52 AM UTC

Hi Eric,


We have checked the sample and we let you know that you have used the event template and applied the color to the template wrapper. So that the event color is not applied for the whole appointment. So we suggest to use the eventRendered event to achieve your requirement. Please find the sample below.


function
applyCategoryColor(argscurrentView) {

  
var categoryColor = args.data.eventcolor;

    if (!args.element || !categoryColor) {

        return;

    }

    if (currentView === 'Agenda') {

        (args.element.firstChild).style.borderLeftColor = categoryColor;

    } else {

        args.element.style.backgroundColor = categoryColor;

    }

}


Modified Sample: https://stackblitz.com/edit/otywyh-beouwy?file=index.js


Output:


For more references, please visit to the below link.


https://ej2.syncfusion.com/javascript/documentation/schedule/appointments/#using-eventrendered-event


Kindly check the modified sample and let us know if this meets your requirement.


Regards,

Ruksar Moosa Sait


Marked as answer

ER Eric April 28, 2022 01:32 PM UTC

Awesome. Thanks. Great support !



VM Vengatesh Maniraj Syncfusion Team April 29, 2022 03:52 AM UTC

You are most welcome!!!


Loader.
Up arrow icon