[英]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
使用Fullcalendar
: https : //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.