如何在使用Google日历Feed时禁用FullCalendar中的事件链接? [英] How to disable event links in FullCalendar when using Google Calendar feed?

查看:104
本文介绍了如何在使用Google日历Feed时禁用FullCalendar中的事件链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用FullCalendar库从Google日历加载日历中的事件。
不幸的是,事件添加到日历后,它们是可点击的。当您点击该活动时,系统会自动将其重定向到Google日历页面以查看该特定活动,或者您拥有访问权限 - 直接编辑它。
虽然这对事件管理非常有用,但我无法想象为什么网站访问者希望每次点击日历中的事件时都将其重定向到外部页面。



有没有办法在FullCalendar中禁用点击打开功能,覆盖打开空javascript函数调用的链接也可以作为选项。

解决方案

可能值得在fullcalendar选项中尝试自己的事件渲染器:

  {eventRender:function (event,element)} 

为此,您需要自己编写所有渲染代码 - 可以从原始实现开始并根据需要进行调整。

没有尝试过这种谷歌日历实现,但已经使用它与自定义json根据需要打开或关闭href。

或者,您可以:

解析gcal.js文件,使其不会在事件对象上设置href属性。



在渲染前拦截事件数据,并删除href属性。


I am using FullCalendar library to load events in my calendar from Google Calendars. Unfortunately after events have been added to the calendar, they are clickable. When you click on the event you are automatically redirected to the Google Calendars page to view that specific event, or if you have enaught access rights - to directly edit it. While this is very useful for event management, I cannot imagine why a site visitor would like to be redirected to an external page every time he clicks on event in a calendar.

Is there a way to disable "open on click" in the FullCalendar, overwriting link opening to an empty javascript function call could also be an option.

解决方案

Might be worth trying your own event renderer in the fullcalendar options:

{ eventRender:function (event, element)}  

To do this, you will need to write all of the rendering code yourself - can start with the original implementation and tweak as needed.
Have not tried this wih a google calendar implementation, but have used it with custom json to turn on or off href as needed.

Alternatively, you could:
Hack the gcal.js file to make it not set the href property on the event objects.
Or
Intercept the event data before rendering, and remove the href property.

这篇关于如何在使用Google日历Feed时禁用FullCalendar中的事件链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆