【问题标题】:Fullcalendar event height is zeroFullcalendar 事件高度为零
【发布时间】:2014-03-10 16:19:40
【问题描述】:

我正在使用Fullcalendar,它之前运行良好,但今天我重用它,它有问题,所有事件的高度 = 0

下面是我的代码:

$('#calendar').fullCalendar({
        header:{
            left:'title',
            center:'',
            right:'prev,next,today agendaWeek,agendaDay'
        },
        buttonText:{
            prev:'<span>&lsaquo;</span>',
            next:'<span>&rsaquo;</span>'
        },
        defaultView:'agendaWeek',
        aspectRatio:3,
        selectable:true,
        selectHelper:true,
        theme:false,
        editable:false,
        allDaySlot:false,
        droppable:false,
        slotMinutes: <?php echo Yii::app()->params['app_rust_appointment_duration'] ?>,
        events:{
            url:'<?php echo $this->createUrl('getCustomer') ?>',
            success: function (data) {
                console.log(data);
            }
        }
    });

Ajax 结果:

[{ "id": "1", "title": "Khanh Tran", "start": "2014-03-03 08:00:00", "end": "2014-03-03 08:00:45", "allDay": false },{ "id": "2", "title": "Khanh Tran", "start": "2014-03-06 08:00:00", "end": "2014-03-06 08:00:45", "allDay": false },{ "id": "3", "title": "Khanh Ngam", "start": "2014-03-06 19:15:00", "end": "2014-03-06 19:15:45", "allDay": false }]

我遇到了这样的问题:

请帮帮我

谢谢

【问题讨论】:

  • 您使用的是什么版本的全日历?
  • 您的活动似乎有 45 秒长,这对您来说是一个常见的活动持续时间吗?
  • 感谢您的检测,我没有看到这个,我的控制器有问题。

标签: javascript fullcalendar


【解决方案1】:

您的活动似乎有 45 秒长。如果您的事件确实是 45 秒长,您可以更新 fc-event 以具有最小高度。

fullcalendar.css 中的示例:

.fc-event {
border: 1px solid #3a87ad;
background-color: #3a87ad;
color: #fff;
font-size: .85em;
cursor: default;
min-height: 15px; // additional styling here
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-17
    • 2020-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多