简体   繁体   English

我如何在Fullcalendar中进行不同类型的事件?

[英]How can I have different type of events in Fullcalendar?

I'm trying to have two sort of events in full calendar. 我正在尝试在日历中安排两种活动。

One of them is clickable and open a popup when I click on them. 其中之一是可单击的,当我单击它们时会打开一个弹出窗口。

The others one don't take care if I click on them. 如果我单击其他人,则不会在意。

I'm using Fullcalendar with Symfony : https://github.com/adesigns/calendar-bundle 我在Symfony使用Fullcalendarhttps : //github.com/adesigns/calendar-bundle

Anybody know how to do that? 有人知道该怎么做吗?

EDIT: 编辑:

In my calendar-settings.js: 在我的calendar-settings.js中:

$('#calendar-holder').fullCalendar({


    select: function (start, end, jsEvent, view) {
        alert("test");
    }),
    eventSources: [
        {
          url: Routing.generate('fullcalendar_loader'),
          type: 'POST',
          data: {},
          error: function () {},
       },
    ]

Then in my CalendarEventListener I have: 然后在我的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);
 }

One way may be to have a property 'clickable' or something in the event object set to true/false, and then upon eventClick only proceed where it is clickable = true? 一种方法可能是将属性'clickable'或事件对象中的某些内容设置为true / false,然后在eventClick上仅在clickable = true的地方继续?

eventClick: function (event, jsEvent, view) {
    if (event.clickable === false) { return; }
    // Else, carry on
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在全日历中将事件绑定到时隙? - How can I bind events to the timeslot in fullcalendar? 如何将数组对象绑定到 FullCalendar 事件? - How can I bind an array object to FullCalendar events? 如何使用复选框过滤FullCalendar中的事件? - How can I use checkboxes to filter events in FullCalendar? FullCalendar-使用“事件作为函数”方法加载事件,如何获取事件以通过JavaScript重新加载 - FullCalendar - Using 'Events as function' method for loading events, how can I get events to reload via javascript 如何更改fullCalendar中类型的事件背景颜色? - How to change events background colour of a type in fullCalendar? FullCalendar - 我无法检索日历上的事件 - FullCalendar - I can't retrieve the events on the calendar 如何禁用全日历中具有特定日期的事件的需要? - How can I disable the need for an event to have specific date in Fullcalendar? 如何将fullcalendar.io用作type =“ date”选择器? - How can I use fullcalendar.io as a type=“date” picker? 在fullcalendar.js中,如何设置eventLimit仅适用于某些事件? - In fullcalendar.js, how can I set eventLimit to only apply to certain events? 在全日历中加载事件时,如何指定开始日期和结束日期? - How can I specify start date and end date when loading events in fullcalendar?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM