Adam Shaw在Fullcalendar中调整自定义视图
我按照中的大纲在fullcalendar中创建了自定义的垂直周视图 该实现摘自此提琴中显示的原始帖子: 该视图的布局如下所示:Adam Shaw在Fullcalendar中调整自定义视图,fullcalendar,Fullcalendar,我按照中的大纲在fullcalendar中创建了自定义的垂直周视图 该实现摘自此提琴中显示的原始帖子: 该视图的布局如下所示: <table> <thead> .tr.td.headercontent.... </thead> <tbody> .tr.td.eventcontent.... </tbody> </table> td.fc-event-container { padding
<table>
<thead>
.tr.td.headercontent....
</thead>
<tbody>
.tr.td.eventcontent....
</tbody>
</table>
td.fc-event-container {
padding-left: 68px;
}
.tr.td.headercontent。。。。
.tr.td.eventcontent。。。。
然而,vertWeek视图用于小屏幕(智能手机等),因此我希望将日标题和内容水平放置,以减少在高度上占用的空间,如下图所示:
那人8岁。我喜欢手动设置样式,但TIR 9是视图呈现的方式
我希望做到这一点:
<table>
<thead>
</thead>
<tbody>
<tr>
<td> headercontent
<td> eventcontent
</tr>
</tbody>
</table>
头部内容
事件内容
我试图理解完整的日历代码,以便将标题移动到与eventcontent相同的位置,但似乎视图在该容器的AD和tbody的不同位置呈现
有人能告诉我如何修改代码以实现这一点的正确方向吗?分享实现答案的帖子: 看来我的理解有点不准确。标题放在包含事件的表上方的重叠表中。尝试在dayRender函数期间遍历DOM并放置标头,但尚未创建事件的相应tbody 简图:
table
thead
**header**
tbody
table
thead
tbody (not created at dayRender, but available at eventRender)
**event*
解决方案非常简单-隐藏.fc日数:
dayRender: function( date, cell ) {
// Get the current view
var view = $('#meal_calendar').fullCalendar('getView');
// Check if the view is the new vertWeek -
// in case you want to use different views you don't want to mess with all of them
if (view.name == 'vertWeek') {
// Hide the widget header - looks wierd otherwise
$('.fc-widget-header').hide();
// Remove the default day number with an empty space. Keeps the right height according to your font.
//$('.fc-day-number').html('<div class="fc-vertweek-day"> </div>');
$('.fc-day-number').hide();
// Create a new date string to put in place
var this_date = date.format('ddd, MMM Do');
// Place the new date into the cell header.
cell.append('<div class="fc-vertweek-header"><div class="fc-vertweek-day">'+this_date+'</div></div>');
}
},
很可能要花上几个小时来研究,还要修改两行。但对我来说