dpm91915 2018-04-01 19:58
浏览 50

Symfony 3 FullCalendarBundle数据加载

I am implementing FullCalendarBundle into Symfony 3.4 but I am struggling to load data into calendar. The calendar works fine but I cannot see my own event.

I did read the documentation and now I am trying to get an inspiration from this example.

The data I am loading is the Event entity with title and date.

I made this listener based on documentation and example:

LoadDataListener.php

namespace AppBundle\Listener;

use AncaRebeca\FullCalendarBundle\Event\CalendarEvent as BundleCalendarEvent;
use AncaRebeca\FullCalendarBundle\Model\Event as BundleEvent;
use AppBundle\Entity\Event as MyEvent;


class LoadDataListener
{
    public function loadData(MyEvent $event, BundleCalendarEvent $calendarEvent)
    {
        $calendarEvent->addEvent(new BundleEvent($event->getName(), $event->getDateTime()));
    }
}

and than I load the data to calendar with:

$loading = new LoadDataListener();
$loading->loadData($event, new CalendarEvent($event->getDateTime(), $event->getDateTime(), array()));

If I understand it correctly, here is the part where I can set up the method how to load the events (fullcalendar.default-settings.js).

    eventSources: [
    {
        url: /full-calendar/load,
        type: 'POST',
        data: {
            filters: { param: foo }
        }
        error: function() {
           //alert()
        }
    }

Thanks a lot for any idea.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
    • ¥15 gdf格式的脑电数据如何处理matlab
    • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
    • ¥100 监控抖音用户作品更新可以微信公众号提醒
    • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
    • ¥70 2048小游戏毕设项目
    • ¥20 mysql架构,按照姓名分表
    • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
    • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
    • ¥15 linux驱动,linux应用,多线程