Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating event #50

Open
marmanova3 opened this issue Apr 1, 2018 · 0 comments
Open

Creating event #50

marmanova3 opened this issue Apr 1, 2018 · 0 comments

Comments

@marmanova3
Copy link

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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant