FullCalendar - 更改事件(约会,日记条目)的高度 [英] FullCalendar - Change event (appointment, diary entry) height

查看:127
本文介绍了FullCalendar - 更改事件(约会,日记条目)的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在FullCalendar中更改事件(约会)的高度。



我在此答案中遵循了建议如何在FullCalendar中编辑事件的宽度?



问题是我不太清楚如何设置高度,以便它相对于日历大小。



我试过这个:

  eventAfterRender:function(event,element,view){
$(element).css('height' ,'100%');
}

但它实际上显示为很薄的条子,同样为200%它没有效果。



这样做:

  eventAfterRender: function(event,element,view){
$(element).css('height','200px');
}

但它仅适用于1920 x 1080分辨率。小的决议会导致任命溢出,这是不好的。

任何想法如何设置事件的高度与单元格相同?

p>

,甚至更好的单元格的实际可用高度。因为事件只显示在日期之下。



这个日历的使用是针对只有全天事件的应用程序,所以它不会是一个问题每个单元格获得一个事件。



TIA

解决方案

尝试这样的事情:

pre $ event $ {code> eventRender:function(event,element,view){
var cellheight = $(' .fc-小窗口内容')的高度();
$(element).css('height',cellheight);
},

与eventAfterRender似乎并不一样,但如果您玩有一点你应该得到一些东西来满足你的需求

I'm trying to change the height of an event (appointment) in FullCalendar.

I followed the suggestion in this answer How to edit width of event in FullCalendar?

The problem is that I'm not too sure how to set the height so that it's relative to the calendar size.

I tried this:

  eventAfterRender: function (event, element, view) {
    $(element).css('height', '100%');
    }

but it actually shows as a thin sliver, ditto for 200%, as if it's not having an effect.

This works:

  eventAfterRender: function (event, element, view) {
    $(element).css('height', '200px');
    }

but it's only good for 1920 x 1080 resolution. Smaller resolutions will cause the appointments to spill over, which is not good.

Any ideas how to set the height of the event to be the same as the cell?

or even better the actual available height of the cell. As events are only displayed below the date.

The usage of this calendar is for an application that only has full day events, so it won't be an issue to just get a single event per cell.

TIA

解决方案

You could try something like this:

eventRender: function(event, element, view) {
    var cellheight = $('.fc-widget-content').height();
    $(element).css('height', cellheight);
},

Doesn't seem to work as well with eventAfterRender but if you play around with it a bit you should get something to meet your needs

这篇关于FullCalendar - 更改事件(约会,日记条目)的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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