FullCalendar事件点击FancyBox(v2) [英] FullCalendar event click through FancyBox (v2)

查看:143
本文介绍了FullCalendar事件点击FancyBox(v2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在整个项目中使用FancyBox,并希望将FancyBox实现到FullCalendar脚本中。基本上,我想弄清楚如何将事件的描述传递给FancyBox弹出窗口。我正在使用11种不同的Google日历Feed。我担心这可能会阻止这种情况发生。如果是这样的话,我可能会完全放弃这个想法。



我见过类似于我的其他问题,例如使用events.push部分gcal.js文件,但我似乎无法弄清楚如何让别人的解决方案工作。我看过的其他一些问题是:



有没有办法将gcal.js文件的events.push部分传递给FancyBox弹出?还是有其他方法可以将事件描述传递给FancyBox?我应该考虑将我的Google日历Feed转换为JSON字符串,而是使用PHP / MySQL创建和存储事件?我可以忽略明显的东西吗?



以下是我用来在eventClick上触发FancyBox的当前脚本。



< pre $ eventClick:function(event){
if(event.url){
$ .fancybox({$ b $'type':'iframe',
'href':'event.url'
})
return false;




$ b在目前的形式中,显然没有提到events.push或类似的东西。它适用于启动FancyBox,但没有其他许多。使用event.url就像我现在,我给了一个缺少的页面错误,但我相信这可能是由于我在本地而不是在活动服务器上进行测试。不过,我可能会误解。



我很感激任何帮助。谢谢。

解决方案

所以,在前一天晚上发布我的问题之后,我刚刚找到了解决方案。对于有这个问题的其他人,这里是我所做的:

  eventClick:function(event){
if (event.url){


var fancyContent =('< div class =header>事件详情< / div>< div id =pracclass = < b>< label>< b>事件:< / b>< / label>'+ event.title +'< br>'+'< label>< b> Date:< / b>< / label>'+ event.date +'< br>'+'< label>< b>开始时间:< / b>< / label>'+ event.start +' < />< label>< b>结束时间:< / b>< / label>'+ event.end +'< b>'+'< label>< b>说明:< / b>< / label>'+'< div class =event_desc>'+ event.description +'< / div>'+'< +>< label> ;< b>位置:< / b>< / label>< a href ='+ event.url +'>'+ event.location +'< / a>'+'< br> '+'< / div> );

$ .fancybox({
'content':fancyContent
})
return false;
}
}

然而,我很难编辑gcal .js文件将ISO8601设置为h:mmTT的时间,我想知道是否可以像上面所用的那样有一个单独的日期类别(以当前形式返回为undefined)。也许在未来的FullCalendar版本中?


I'm using FancyBox throughout the project I'm working on, and would like to implement FancyBox into the FullCalendar script. Basically, I want to figure out how to pass the event's description to a FancyBox pop up. I'm using 11 different Google Calendar feeds. I fear that may prevent this from happening. If that is the case, I'll likely give up this idea entirely.

I've seen other questions similar to mine, such as using the events.push section of the gcal.js file, but I can't seem to figure out how to make others' solutions work. Some of the other questions I've looked at are:

Is there a way to pass the events.push section of the gcal.js file to a FancyBox pop up? Or is there some other way to pass the event description to FancyBox? Should I consider converting my Google Calendar feeds to JSON strings and instead use PHP/MySQL to create and store events? Am I overlooking something blatantly obvious?

Here is the current script I'm using to fire FancyBox on eventClick.

  eventClick: function(event) {
    if (event.url) {
        $.fancybox({
            'type': 'iframe',
            'href': 'event.url'
        })
        return false;
    }
  }

In its current form, there is clearly no mention of events.push or anything similar. It works great for launching FancyBox, but not much else. Using event.url like I am now, I'm given a missing page error, but I believe that may be due to the fact that I'm testing this locally and not on a live server. I could be mistaken, however.

I would appreciate any help. Thank you.

解决方案

So, naturally after posting my question the night before, I just found a solution. For anyone else who has this problem, here is what I did:

eventClick: function(event) {
    if (event.url) {


        var fancyContent = ('<div class="header">Event Details</div> <div id="prac" class="pracform"> <label><b>Event: </b></label>' + event.title + '<br>' + '<label><b>Date: </b></label>' + event.date + '<br>' + '<label><b>Start Time: </b></label>' + event.start + '<br>' + '<label><b>End Time: </b></label>' + event.end + '<br>' + '<label><b>Description: </b></label>' + '<div class="event_desc">' + event.description + '</div>' + '<br>' + '<label><b>Location: </b></label><a href=' + event.url + '>' + event.location + '</a>' + '<br>' + '</div>');

        $.fancybox({
            'content': fancyContent
        })
        return false;
    }
}

I am, however, having difficulty with editing the gcal.js file to change the time set from ISO8601 to h:mmTT, and I'm wondering if it's possible to have a separate date category as I've used above (in its current form it returns as "undefined"). Maybe in a future release of FullCalendar?

这篇关于FullCalendar事件点击FancyBox(v2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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