Styling a single Event in the calendar

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I came up with the following jQuery statement that highlights an event in the calendar:

skuid.jQuery(".nx-cal-event:has(a[href='/00U0G00000k2jb0UAA']) ").addClass("highlightAppointment")

this is very specific and it only selects an event that has a child a tag with an href to a particular SF Id.  This works great when I am using the console.  It highlights the event.

However there are two issues:

1) Whenever I do something with the calendar the highlight goes away.

2) I am trying to add the same command when the calendar is first loaded but I don't get the same results.  In fact nothing happens. 

 $(document.body).one('pageload',function() {
        CAL.ChangeView("week");
        
        
        skuid.jQuery(".nx-cal-event:has(a[href='/00U0G00000k2jb0UAA']) ").addClass("highlightAppointment");
        
  
        
    });

Any thoughts.  Thank you.
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,354 Points 1k badge 2x thumb
Ok.  I think is answer my own questions night!

I came up with this that works after reading another post here.

https://community.skuid.com/skuid/topics/is-there-an-event-that-can-be-hooked-in-to-when-the-calenda...

 Basically hooking up to the calendar's draw Events.

   var defaultDrawEvent = skuid.calendar.Calendar.prototype.drawEvents;    skuid.calendar.Calendar.prototype.drawEvents = function() {
        defaultDrawEvent.apply(this);
        skuid.jQuery(".nx-cal-event:has(a[href='/00U0G00000k2jb0UAA']) ").addClass("highlightAppointment");
    };