douren7921 2016-02-27 23:07
浏览 230
已采纳

如何在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

Anybody know how to do that?

EDIT:

In my 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:

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);
 }
  • 写回答

1条回答 默认 最新

  • dongyong1400 2016-02-28 01:37
    关注

    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?

    eventClick: function (event, jsEvent, view) {
        if (event.clickable === false) { return; }
        // Else, carry on
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件