7
Views
1
Comments
[FullCalendar Reactive] FullCalendar reactive icons in events
Forge component by André Cabral
3
Published on 18 Aug 2020
Application Type
Reactive

Hi everyone,

I'm trying to add icons to events to help flag status' etc.

I have added a boolean value to the event structure called icon and for testing purposes if this is set to true then show an icon. I've been playing with various bits of code I found on other forums but cannot get the icon to display.  I am struggling to access the elements of the event to append/prepend the icon to when using .find() etc. 

What should I be adding to this code to display the icon.


eventRender: function(info) {
    if ( info.event.extendedProps.icon) {
       var i = document.createElement('i');
       i.className = 'fa fa-flag';
        
// I have tried a number of different methods here but all throw errors.Help please.
        
       console.log(info);
        
    }
Rank: #6366

This seems to have done the trick.


eventRender: function(info) {
    
    var i = document.createElement('i');
        if ( info.event.extendedProps.icon) {   
                i.className = 'fa fa-flag';
                info.el.append(i);
                }
}