我想在完整的日曆中有兩種事件。如何在Fullcalendar中使用不同類型的事件?
其中之一是可點擊的,當我點擊它們時打開一個彈出窗口。
其他人不關心,如果我點擊它們。
我使用Fullcalendar
與Symfony
:https://github.com/adesigns/calendar-bundle
任何人都知道該怎麼做?
編輯:
在我的日曆settings.js:
$('#calendar-holder').fullCalendar({
select: function (start, end, jsEvent, view) {
alert("test");
}),
eventSources: [
{
url: Routing.generate('fullcalendar_loader'),
type: 'POST',
data: {},
error: function() {},
},
]
然後在我的CalendarEventListener我:
class CalendarEventListener {
private $entityManager;
public function __construct(EntityManager $entityManager) {
$this->entityManager = $entityManager;
}
public function loadEvents(CalendarEvent $calendarEvent) {
$eventEntity = new EventEntity('firstEvent', new DateTime(), new DateTime());
$calendarEvent->addEvent($eventEntity);
$eventEntity = new EventEntity('secondEvent', new DateTime(), new DateTime());
$calendarEvent->addEvent($eventEntity);
}
我編輯我的職務,我用fullcalendars捆綁在symfony:https://github.com/adesigns/calendar-bundle – anubis
請出示您的事件處理代碼中的插件選項對象。還有事件對象要知道有什麼區別 – charlietfl