Jquery完整日历不渲染

时间:2014-10-20 12:15:44

标签: calendar fullcalendar

我有以下代码将事件呈现给Jquery Full calendar ..

代码将事件作为对象返回,但我不知道如何呈现事件.Pase帮助我理清......

  <script>
$(document).ready(function(){
var pageUrl = '<%=ResolveUrl("~/xtest.aspx")%>';
 $('#calendar').fullCalendar({
 theme: true,
 color: 'red',
 header: { left: 'prev,next', center: 'today,title', right: 'agendaDay,agendaWeek,month' },
 events: function(start, end, timezone, callback) {
       $.ajax({
            type: 'POST',
            url: pageUrl+"/GetEvents",
            data: '{Start: "' + start + '",End: "' + end + '"}',
            contentType: "application/json; charset=utf-8",
            dataType: 'json',
            success: function(response){
            callback(response.d);
            }
        });
        }
   }); 
});
<script>

/ GetEvents返回如下..

[
            {
                title: 'All Day Event',
                start: '2014-09-01'
            },
            {
                title: 'Long Event',
                start: '2014-09-07',
                end: '2014-09-10'
            },
            {
                id: 999,
                title: 'Repeating Event',
                start: '2014-09-09T16:00:00'
            },
            {
                id: 999,
                title: 'Repeating Event',
                start: '2014-09-16T16:00:00'
            },
            {
                title: 'Conference',
                start: '2014-09-11',
                end: '2014-09-13'
            },
            {
                title: 'Meeting',
                start: '2014-09-12T10:30:00',
                end: '2014-09-12T12:30:00'
            },
            {
                title: 'Lunch',
                start: '2014-09-12T12:00:00'
            },
            {
                title: 'Meeting',
                start: '2014-09-12T14:30:00'
            },
            {
                title: 'Happy Hour',
                start: '2014-09-12T17:30:00'
            },
            {
                title: 'Dinner',
                start: '2014-09-12T20:00:00'
            },
            {
                title: 'Birthday Party',
                start: '2014-09-13T07:00:00'
            },
            {
                title: 'Click for Google',
                url: 'http://google.com/',
                start: '2014-09-28'
            }
        ]

0 个答案:

没有答案