FullCalendar dayClick不工作(什么都不做) [英] FullCalendar dayClick not working (does nothing)

查看:701
本文介绍了FullCalendar dayClick不工作(什么都不做)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让'dayClick'功能在FullCalendar上工作,但是当我在任何空闲的日子按下时,什么也没有发生。我搜索了所有的SO,找不到任何解决方案或找出发生了什么。

I am trying to get the 'dayClick' function to work on FullCalendar, but when I press on any empty day, nothing happens. I have searched all over SO and cannot find any solutions or figure out what's going on.

这是我的代码:

   $(document).ready(function () {
        $('#calendar').fullCalendar({
            header: {
                left: 'title',
                center: '',
                right: 'prev,next today'
            },
            defaultView: 'month',
            weekends: false,
            editable: false,
            selectable: true,
            events: "/Home/GetEvents/",

            eventClick: function (calEvent, jsEvent, view) {
                alert('You clicked on event id: ' + calEvent.id
                    + "\nSpecial ID: " + calEvent.someKey
                    + "\nAnd the title is: " + calEvent.title);

            },

            dayClick: function (date, jsEvent, view) {
                alert("Day Clicked");
                $('#eventDate').val($.fullCalendar.formatDate(date, 'dd/MM/yyyy'));
                ShowEventPopup(date);
            }
        });
    });


推荐答案

Singh说他的日历在我的代码中运行良好,我深入了解了我使用的软件包,并注意到我没有使用bootstrap.js,因为这与以前的日历冲突。因此,我在BUT中重新添加了它,将其更新为最新版本,希望它能解决任何依赖冲突。我也更新了我的其他软件包到他们的最新版本,希望这也可以帮助,现在它完美的工作! :)

After spending further time on this and having confirmation from Ram Singh that his calendar worked fine with my code, I dug deeper into the packages I used and noticed I wasn't using bootstrap.js as this previously conflicted with my calendar. Consequently, I added this back in BUT updated it to the latest version in hope that it would resolve any dependency conflicts. I also updated all of my other packages to their latest versions in hope that this would also help and now it works perfectly! :)

希望这些信息可以帮助别人!

Hopefully this information may help someone else!

这篇关于FullCalendar dayClick不工作(什么都不做)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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