fullCalendar:获取事件时向服务器发送视图类型

fullCalendar:获取事件时向服务器发送视图类型,fullcalendar,Fullcalendar,我想根据日历中使用的视图(天/周/月)在日历中显示不同数量的信息,这样时间块就不会太大,而是传递尽可能多的信息。这样做的标准方法是什么 我试着在客户端做这件事(发送所有信息并有选择地展示所需内容)。从技术上讲,它可以工作,但实际上我必须重新编写fullCalendar的事件呈现部分(以操作eventRender中的元素)。我还尝试在事件定义中将视图名称传递给服务器(没有效果) 我是否忽略了一些显而易见的事情?我不会想到第一个有如此琐碎想法的人 //VIEW CHANGE - ALSO ADDS

我想根据日历中使用的视图(天/周/月)在日历中显示不同数量的信息,这样时间块就不会太大,而是传递尽可能多的信息。这样做的标准方法是什么

我试着在客户端做这件事(发送所有信息并有选择地展示所需内容)。从技术上讲,它可以工作,但实际上我必须重新编写fullCalendar的事件呈现部分(以操作eventRender中的元素)。我还尝试在事件定义中将视图名称传递给服务器(没有效果)

我是否忽略了一些显而易见的事情?我不会想到第一个有如此琐碎想法的人

 //VIEW CHANGE - ALSO ADDS INITIAL SOURCES PER DAY VIEW
        viewDisplay: function (view) {
            if (lastView == undefined) { lastView = 'firstRun'; }

            //            if (isCustomDate == 'True') {
            //                lastView = 'basicDay';
            //                $('#calendar').fullCalendar('gotoDate', passedYear, passedMonth, passedDay);
            //                }

            if (view.name != lastView) {
                if (view.name == 'month') {
                    if (brsEnabled == 'True') { $('#calendar').fullCalendar('removeEventSource', 'diaryFeed.aspx?style=brsComplex'); $('#calendar').fullCalendar('addEventSource', 'diaryFeed.aspx?style=brsBasic'); }
                    if (activeEnabled == 'True') { $('#calendar').fullCalendar('removeEventSource', 'diaryFeed.aspx?style=fixturesComplex'); $('#calendar').fullCalendar('addEventSource', 'diaryFeed.aspx?style=fixturesBasic'); }
                    if (previousEnabled == 'True') { $('#calendar').fullCalendar('removeEventSource', 'diaryFeed.aspx?style=previousComplex'); $('#calendar').fullCalendar('addEventSource', 'diaryFeed.aspx?style=previousBasic'); }
                    if (newsEventEnabled == 'True') { $('#calendar').fullCalendar('removeEventSource', 'diaryFeed.aspx?style=newsEvents'); $('#calendar').fullCalendar('addEventSource', 'diaryFeed.aspx?style=newsEvents'); }
                }
                if (view.name == 'basicDay') {
                    if (brsEnabled == 'True') { $('#calendar').fullCalendar('removeEventSource', 'diaryFeed.aspx?style=brsBasic'); $('#calendar').fullCalendar('addEventSource', 'diaryFeed.aspx?style=brsComplex'); }
                    if (activeEnabled == 'True') { $('#calendar').fullCalendar('removeEventSource', 'diaryFeed.aspx?style=fixturesBasic'); $('#calendar').fullCalendar('addEventSource', 'diaryFeed.aspx?style=fixturesComplex'); }
                    if (previousEnabled == 'True') { $('#calendar').fullCalendar('removeEventSource', 'diaryFeed.aspx?style=previousBasic'); $('#calendar').fullCalendar('addEventSource', 'diaryFeed.aspx?style=previousComplex'); }
                    if (newsEventEnabled == 'True') { $('#calendar').fullCalendar('removeEventSource', 'diaryFeed.aspx?style=newsEvents'); $('#calendar').fullCalendar('addEventSource', 'diaryFeed.aspx?style=newsEvents'); }
                }
                lastView = view.name;
            }
        },

这是我找到的唯一方法——在服务器端,我查看传递的样式,然后生成应该返回的json。

brrrr。。。我知道你在做什么,我会尝试一下(也许在周末),但它很难看;我们不同意吗?:)它非常难看-但信不信由你,这是一个星期的混乱-我不是一个硬核JS'er-不想重新编码fullcalendar的核心,以防升级出来-这是难看的-但它与fullcalendar一起工作没有黑客