如何在fullcalendar中显示事件的描述 [英] How to show description of Events in fullcalendar

查看:677
本文介绍了如何在fullcalendar中显示事件的描述的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一些标题和描述的事件。我想知道如何在fullcalendar中显示事件的描述。

那么如何显示说明?

解决方案

工作的jquery或JavaScript代码。

我喜欢 Bootbox.js 来显示消息,所以我在这里也实现了这个功能:

  $(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用于在视图之间切换
defaultDate:today_date,
businessHours:
{
rendering:'inverse -background',
dow:[0,1]
},
可编辑:false,
eventLimit:true,//当事件太多时允许更多链接
events:myevents,
eventRender:function(event,element){
element.attr('href','javascript:void(0);');
element.click(function(){
bootbox.alert({
message:'Description:'+ event.description,
title:event.title,
});
});
}

});

});


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?

解决方案

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,
                            });
                        });
                    }

    });

});

这篇关于如何在fullcalendar中显示事件的描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆