0

如何在完整日历月视图中仅显示 allDay = true 事件,并在其他视图中显示剩余的非所有 Day 事件

4

2 回答 2

2

您可以通过在 eventRender 之类的回调中检查 view.name 来做到这一点。看看这个小提琴:http: //jsfiddle.net/100thGear/vyKSZ/

希望这可以帮助!

于 2012-05-23T13:18:33.427 回答
0
 $('#external-events div.external-event').each(function() {
        // store data so the calendar knows to render an event upon drop
        $(this).data('event', {
            title: $.trim($(this).text()), // use the element's text as the event title
            stick: true // maintain when user navigates (see docs on the renderEvent method)
        });
        // make the event draggable using jQuery UI
        $(this).draggable({
            zIndex: 1111999,
            revert: true,      // will cause the event to go back to its
            revertDuration: 0  //  original position after the drag
        });
    });
    /* initialize the calendar
     -----------------------------------------------------------------*/
    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();
    $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek'
        },
        editable: true,
        droppable: true, // this allows things to be dropped onto the calendar
        drop: function() {
            // is the "remove after drop" checkbox checked?
            if ($('#drop-remove').is(':checked')) {
                // if so, remove the element from the "Draggable Events" list
                $(this).remove();
            }
        },
        eventDrop: function(event, delta, revertFunc) {
            alert( event.id );
            $.ajax({
                type: "POST",
                url: "${pageContext.request.contextPath}/task/periodic-task-update",
                data : {
                    id : event.id , 
                    date :event.start.format()
                },
                success: function(data) {
                     if(data=='Task Period Succesfully Changed'){
                        toastr.success("Task Period Succesfully Changed.");
                    }else{
                        toastr.success("Something Wrong");
                        revertFunc();
                    } 
                },
                error: function(data,textStatus,xhr) {
                    toastr.success("Something Wrong");
                    revertFunc();
                }       
            });
        },
        events: [
                <c:forEach var='periodicTask' items='${periodicTaskTemplates}'>
                    <c:forEach  varStatus="i" begin = "1" end = "12">
                        { id: '${periodicTask.id}', title: '${periodicTask.task}', start: new Date(y,  '${i.index}', '${periodicTask.startDate}'), end: new Date(y, '${i.index}', '${periodicTask.lastDate}') ,type:'${periodicTask.description}',location:'${periodicTask.location.name}'},
                    </c:forEach>
                </c:forEach>`
        ],
    });
于 2017-08-31T06:21:22.907 回答