fullcalendar jQuery - 可以从Google日历事件中检索描述? [英] fullcalendar jQuery - Possible to retrieve description from Google Calendar events?

查看:83
本文介绍了fullcalendar jQuery - 可以从Google日历事件中检索描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了fullcalendar来加载一些Google日历事件,但是想知道是否有任何方法来加载描述或其他数据,而不是标题和时间?



我想抓住'description'和'where'字段来处理Google日历活动,并将其显示在fullcalendar的工具提示中。



我正在考虑尝试解析event.url结果,但由于跨域ajax请求,它不起作用。我想这可能是通过代理php脚本或crossframe jquery的东西,但我想知道如果fullcalendar提供更清楚地访问这些数据? (或者如果有人有更好的主意)



解决方案

不知道他们有这个:有趣的发现。
如果您查看gcal.js源文件,有一段代码如下所示:

  events .push({
id:entry ['gCal $ uid'] ['value'],
title:entry ['title'] ['$ t'],
url:url ,
start:start,
end:end,
allDay:allDay,
location:entry ['gd $ where'] [0] ['valueString'],
description:entry ['content'] ['$ t']
});

我的期望是您可以使用位置描述字段来完成您想要的功能。实际上,您可能会添加您想要的条目对象中的任何其他字段:您需要知道您拥有哪些选项,但 http://code.google.com/apis/gdata/samples/cal_sample.htmlrel =nofollow> http://code.google.com/apis/gdata/samples/cal_sample.html 制作它很简单。我很好奇他们为什么不只是将整个条目对象作为一个字段来添加,这样所有的数据都可以在你想要的时候访问。


I have setup fullcalendar to load a number of google calendar events but was wondering if there is any way to load the description or other data from the event other than the title and times?

I'd like to grab the 'description' and 'where' fields froom google calendar events and display them in a tooltip in fullcalendar.

I was thinking of trying to parse the event.url results but it doesn't work due to cross-domain ajax requests. I suppose it may be possible through a proxy php script or the crossframe jquery thing, but I'm wondering if fullcalendar provides any access to this data more cleanly? (or if anyone has a better idea)

解决方案

No idea they had this: interesting find. If you look in the gcal.js source file, there's an block of code that looks like this:

events.push({
                        id: entry['gCal$uid']['value'],
                        title: entry['title']['$t'],
                        url: url,
                        start: start,
                        end: end,
                        allDay: allDay,
                        location: entry['gd$where'][0]['valueString'],
                        description: entry['content']['$t']
                    });

My expectation is that you can use the location and description fields to do what you want.

In fact, you could probably add any other fields from the entry object that you wanted: you'd need to know what options you have, but http://code.google.com/apis/gdata/samples/cal_sample.html makes it pretty straightforward to do. I'm curious why they didn't just add the entire entry object as a field, that way ALL the data would be accessible if/when you wanted it.

这篇关于fullcalendar jQuery - 可以从Google日历事件中检索描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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