jQuery FullCalendar not rendering

◇◆丶佛笑我妖孽 提交于 2019-12-22 03:22:27

问题


I have a working fullcalendar on my site, however, the actual calendar table doesn't show until you change the month/year or select "today".

If I look at the rendered source, I see that the div around the table is empty until I press a button.

<div style="position: absolute; -moz-user-select: none;" class="fc-view fc-view-month fc-grid" unselectable="on"></div>

Does anyone have a clue why this is happening?


回答1:


Do you have this calendar in a tab or a dialog, which is hidden from view at first?

If so, you need to explicitly render the fullCalendar when that control is active.

Let's say you are using the jQuery UI Tabs widget and have the FullCalendar in the 2nd tab (which is hidden from view till the 2nd tab is selected). In this case, you could do something like this:

$('#tabs').tabs({
    show: function(event, ui) {
        $('#calendar').fullCalendar('render');
    }
});

This makes sure that the calendar is rendered when the tab is shown. Hope this helps!



来源:https://stackoverflow.com/questions/10340362/jquery-fullcalendar-not-rendering

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