Full Calendar MVC

ITsolutionWizard
ITsolutionWizard used Ask the Experts™
on
I use fullcalendar plugin with mvc.
I knew my MVC API is working and return data. But I do not see the return data on the calendar.
What did i do wrong in Event Push in Jquery?


<script>
        function Can() {
            $('#calendar').fullCalendar({
                header:
                {
                        left: 'prev,next today',
                        center: 'title',
                        right: 'month,basicWeek,basicDay'
                    },
                buttonText: {
                    today: 'today',
                    month: 'month',
                    week: 'week',
                    day: 'day'
                },
                views: {
                    basicWeek: {
                        type: 'basic',
                        duration: { months: 3 },
                        rows: 8
                    }
                },
                events: function (start, end, timezone, callback) {
                    $.ajax({
                        url: '/Park/bookinglist',
                        type: "Post",
                        dataType: "JSON",
                        success: function (result) {
                         var events = [];
                         $.each(result, function (i, data) {
                             //alert(data.ParkProductInventoryCustomNo);
                               events.push(
                               {
                                   title: "test",
                                   description: data.ParkProductInventoryCustomNo,
                                   start: moment(data.CheckIn).format('YYYY-MM-DD'),
                                   end: moment(data.CheckOut).format('YYYY-MM-DD'),
                                   backgroundColor: "#9501fc",
                                   borderColor: "#fc0101"
                               });
                            });
                            callback(events);
                        }
                    });
                },
                eventRender: function (event, element) {
                    element.qtip(
                    {
                        content: event.description
                    });
                },
                editable: false
            });
        }
</script>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior .Net Full Stack Developer
Commented:
Put some alerts in your call so you can see where it executes.
Robb HillSenior .Net Full Stack Developer

Commented:
success: function (data) {                        
var events = $.map(data.d, function (item, i) {
   var event = new Object();
   //load up event
   return event;
});
});

Open in new window

Author

Commented:
sorry I don't get it.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial