按键时jQuery fullcalendar不会获取事件

时间:2014-10-23 12:57:29

标签: javascript jquery jquery-plugins fullcalendar jquery-events

我有简单搜索的jQuery fullcalendar。

        search.keyup(function( event ) {
            calendar.fullCalendar('refetchEvents');
            var keycode = (event.keyCode ? event.keyCode : event.which);
            if ( keycode !== 13 ) {
                throw ('Script Exit');
            }
            else{
                events = $('#calendar').fullCalendar('clientEvents');
                searchValue(events);
            }
        });

当我在搜索输入中按任意键时,我看到fullcalendar从我的PHP脚本获取源代码。我怎么能关掉这个?

1 个答案:

答案 0 :(得分:1)

这就是我要做的事情:

    var calendar = $('#calendar').fullCalendar({
        header: {
            left: 'month',
            center: 'title',
            right: 'prev, next'
        }
        // other options...
    });

        function getCurrEventsArr(calendar) {
            var events_arr = new Array();
            calendar.fullCalendar('clientEvents', function(event) {
                event = "";//code to make any changes to event
                events_arr.push(event);
            });
            return events_arr;
        }

       search.keyup(function() {
          var events =  getCurrEventsArr(calendar);
          console.log(events);
       });