【问题标题】:Display only allDay events in a month view full calendar仅显示月份中的 allDay 事件 查看完整日历
【发布时间】:2012-05-23 09:11:49
【问题描述】:

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

【问题讨论】:

    标签: fullcalendar


    【解决方案1】:

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

    希望这会有所帮助!

    【讨论】:

    • 小提琴坏了
    【解决方案2】:
     $('#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>`
            ],
        });
    

    【讨论】:

    • 该函数实现jstl标签库
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-05
    • 2013-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-15
    • 1970-01-01
    相关资源
    最近更新 更多