How to show description of Events in fullcalendar

让人想犯罪 __ 提交于 2019-12-11 02:54:26

问题


I wan to know that How to show description of Events in fullcalendar.

I have events that have title and description.

So how can show description?


回答1:


When you add title and description it will concatenate. Using bellow code you can concatenate with title

eventRender: function (event, element, view) {
    element.find('.fc-title').append('<div class="hr-line-solid-no-margin"></div><span style="font-size: 10px">'+event.description+'</span></div>');
},



回答2:


Hi Here is the working jquery or JavaScript code.

I love Bootbox.js for showing message so I implemented that also here:

$(document).ready(function() {

    var today_date = moment().format('YYYY-MM-DD');
    console.log(today_date);
    // $('#calendar').fullCalendar('gotoDate', today_date);
    $('#calendar').fullCalendar({
        theme: false,
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,basicWeek'
            // right: 'month,basicWeek,basicDay'
        },
        // header: { center: 'month,agendaWeek' }, // buttons for switching between views
        defaultDate: today_date,
        businessHours:
         {
            rendering: 'inverse-background',
            dow: [0,1] 
         },
        editable: false,
        eventLimit: true, // allow "more" link when too many events
        events: myevents,
                 eventRender: function (event, element) {
                        element.attr('href', 'javascript:void(0);');
                        element.click(function() {
                            bootbox.alert({
                                  message: 'Description : '+event.description,
                                  title: event.title,
                            });
                        });
                    }

    });

});


来源:https://stackoverflow.com/questions/31490108/how-to-show-description-of-events-in-fullcalendar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!