如何使用laravel在fullCalendar中显示事件标题

时间:2014-11-26 18:35:40

标签: jquery events laravel fullcalendar title

我试图为我的客户平台使用fullCalendar插件,但我对事件标题有一个大问题......日历没有显示它!

Here you can see the error page image

这是我的JS代码

$(document).ready(function(){

    $('#calendar').fullCalendar({
        editable: true,
        events: {
            title: 'My Event Title',
            url: '/crud/bussiness/customers/json/{{$id}}',
            color: 'yellow',
            textColor: 'black'
                },
            selectable: true,
            selectHelper: true,
            select: function() {
                 $("#add_booking_modal").trigger("click");
                }
            });
        });

这是我的控制器代码与JSON行动

    if( $acc == 'json' ){
        return \CompanyBussiness::getCustomers($id);
    }
//CompanyBussiness is the model where Im declarating the getCustomers method for show the events

我需要修复它,因为我必须在下周提供这个平台。

请有人帮帮我。

谢谢!

1 个答案:

答案 0 :(得分:0)

您无需提供

title: 'My Event Title',

- 使用events

相反,如果您有多个事件,则加载title以及JSON编码数组。确保从JSON操作中加载“标题”。

如果您使用Chrome或Firefox,则可以直接跟踪它。 请查看

  

检查元素 [F12]> '网络'>选择 XHR 选项

检查您是否有标题作为事件标题传递。一旦你确定它,那么你将得到结果。

谢谢。