Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

Full Calendar MVC

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

ASKER CERTIFIED SOLUTION
Avatar of Robb Hill
Robb Hill
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
success: function (data) {                        
var events = $.map(data.d, function (item, i) {
   var event = new Object();
   //load up event
   return event;
});
});

Open in new window

Avatar of ITsolutionWizard

ASKER

sorry I don't get it.