How to make a basic FullCalendar custom view

做~自己de王妃 提交于 2019-12-05 03:59:11

I've added a few lines to your plunker to make the custom view work. You can find here the example: https://plnkr.co/edit/8iOq15CsL2x6RPt29wgE?p=preview

Just to mention the changes: In the calendar initializer the view definition has been added

$('#calendar').fullCalendar({
...
    views: {
            CustomView: {
                type: 'custom',
                buttonText: 'my Custom View',
                click:  $('#calendar').fullCalendar('changeView', 'CustomView')
            }
        }
});

In the custom view just added this in the render

 $('.fc-view').append("<div>Insert your content here</div").css("background", "red");

In the custom view you get access to the events by doing this:

var myEvents=$('#calendar').fullCalendar('clientEvents');

From there on you can do your further customizations

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