Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6766933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:53:26+00:00 2026-05-26T14:53:26+00:00

When I set-up fullCalendar and set eventRender function callback, I want to set the

  • 0

When I set-up fullCalendar and set eventRender function callback, I want to set the color of the event depending if LeadId is null or not. But this doesn’t seem to work even though the documentation says so: http://arshaw.com/fullcalendar/docs/event_data/Event_Object/#color-options

Is there any way to set the event color to change based on the data?

 calendar = $('#dayview').fullCalendar({
            ....
            timeFormat: 'HH:mm',
            columnFormat: {
                agendaDay: 'dddd dd/MM/yyyy'
            },
            eventClick: function (calEvent, jsEvent, view) {
                var leadUrl = "/Leads/" + calEvent.LeadId;
                window.location = leadUrl;
            },
            eventRender: function (event, element) {
                if (event.LeadId != null) {
                    event.eventColor =  "#B22222";
                    event.eventBackColor = "#B22222";                       
                }
            },

UPDATE:

This is really strange. The event has all my properties returned for the event off the server.
element is just the DOM element for the event. When I drag/move the event to somewhere else in the calendar, the event turns red, and if I inspect the event object it now has color set to Red. So the question is why isn’t it applying on the 1st render, but on subsequent renders (i.e. after move) the colour gets applied?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:53:27+00:00Added an answer on May 26, 2026 at 2:53 pm

    EDIT 2: Some new changes to the fc-event-skin class… it’s now only fc-event, so styling shouldn’t be an issue. Please check author’s note here fullcalendar fc-event class…

    EDIT 1: Maybe not a bug exactly.

    The best approach is to set the className in the event object and add it to the elements found by an ‘fc-event-skin’ class. However, your added class will come later in the css and the colors will not take precedence, so you have to use !important. This also preserves the “fake” rounded corners…

    Wire this method up on the calendar…

    eventRender:
    function (event, element, view) {
        element.find('.fc-event-skin').addClass(event.className.join(' '));
    }
    

    This in your own style sheet…

    .redGray
    {
        border-color: DarkGray !important;
        background-color: LightGray !important;
        color: red !important;
    }
    

    ORIGINAL ANSWER:

    I think this is a minor bug in the rendering code. The element parameter is an jQuery object, so you can modify that based on your custom event data. If you set the style and text of the element, it will render with the color you set; however, it appears to me that other styles are removed from the element such as the rounded corners and the formatting of the time and text.

    eventRender: 
    function (event, element) {
        if (event.LeadId != null) {
            element.css('color', 'blue');
            element.css('background-color', 'yellow');
            element.text(element.text);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

well, I want to set a different color for each event. Basically that's it
set A=2 && echo %A% This does not echo A as 2 in windows.
set phoneNumber 1234567890 this number single digit, i want divide this number into 123
I set a view variable in someAction function like this: $this->view->type = some type;
Set up(MySQL): create table inRelation( party1 integer unsigned NOT NULL, party2 integer unsigned NOT
:set ic ignores the case. How do you unset this?
Set content of table ... ViewState[Table1] = Table1; // When remove this line, table
I set up a website to use SqlMembershipProvider as written on this page .
I set a passphrase when creating a new SSH key on my laptop. But,
I set up 404 handler page in web.config, but it works ONLY when extension

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.