Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eventRender disappears in fullcalendar v5

Version : Fullcalendar-Scheduler v5 beta2

I tried eventRender like below in chrome:

document.addEventListener('DOMContentLoaded', function() {
    var calendarEl = document.getElementById('planningMix');
    var planningMix = $(calendarEl);
    var calendar = new FullCalendar.Calendar(calendarEl, {
        //...
        eventRender: function(info) {
            debugger
          },
        events: function(d, successCallback, failureCallback) {
           //...
        }
    });

    calendar.render();
});

When I run this code, "debugger" didn't fired. eventRender has became another name in V5 ?

like image 562
孙悟空 Avatar asked Apr 28 '20 13:04

孙悟空


People also ask

How do I filter events in FullCalendar?

change(function(){ filter_id = $(this). val(); if (filter_id != 'all') { var events = $('#mycalendar'). fullCalendar( 'clientEvents', function(event) { if((filter_id == 'all') ) { return true; }else{ //what I need to write here to dynamic filter events on calendar? }); } });

How do I display an image in FullCalendar?

You can add any image url to your eventObject by adding the attribute "imageurl" inside of the events definition (if you just want the image, don't specify a title): events: [ { title : 'event', start : '2016-10-12', end : '2016-10-14', imageurl:'img/edit.

How do I resize FullCalendar?

ready(function() { $(window). resize(function() { $('#calendar'). fullCalendar('option', 'height', get_calendar_height()); }); //set fullcalendar height property $('#calendar'). fullCalendar({ //options height: get_calendar_height }); });

What is eventDidMount?

eventDidMount - called right after the element has been added to the DOM. If the event data changes, this is NOT called again. eventWillUnmount - called right before the element will be removed from the DOM.


1 Answers

those who were going to upgrade from V4 to V5, check this document upgrading-from-v4, there were many changes which we need to consider while upgrading.

Example of EventContent

eventContent: function (arg) {

            var event = arg.event;
            
            var customHtml = '';
            
            customHtml += "<span class='r10 font-xxs font-bold' style='overflow: hidden;'>" + event.title + "</span>";
            
            customHtml += "<span class='r10 highlighted-badge font-xxs font-bold'>" + event.extendedProps.age + text + "</span>";
                          

            return { html: customHtml }
        }
like image 132
Sajjad Ali Khan Avatar answered Oct 15 '22 20:10

Sajjad Ali Khan