views:

75

answers:

1

I am able to save the events of particular date wise in database by using fullcalender jQuery. But how to populate the saved events in database on fullcalender jQuery control, of the corresponding date?

A: 

Without knowing what language you are using on the server it makes it a bit hard to give you an answer...

I have used FullCalendar in a few .NET MVC solutions with great success... I return back JSON in the following format (snipped from my existing code):

[{
 id = a.AppointmentID,
 start = a.Appointment.DateTime,
 title = a.Appointment.Total,
 allDay = a.Appointment.AllDay,
 leave = a.Appointment.Leave,
 end = a.Appointment.DateTime.AddHours((double)a.Appointment.Duration),
 url = "/Appointments/Edit/" + a.AppointmentID,
}]

On the client side, I use the following to request the JSON from my MVC Action:

function getEvents(start, end, callback) {
var calendar = $(this);
var id = calendar.attr('staffid');

$.ajax({
    url: '/Appointments/Events',
    dataType: 'json',
    data: {
        start: Math.round(start.getTime() / 1000),
        end: Math.round(end.getTime() / 1000),
        staffID: id,
        _d: new Date().getTime()
    },
    success: function (json) {
        callback(json);
    }
});
}

More information on the Event structure is available in the FullCalendar help at http://arshaw.com/fullcalendar/docs/event_data/Event_Object/ and http://arshaw.com/fullcalendar/docs/event_data/events_json_feed/

Hope this helps.

Boycs
Oh, I am so sorry about I was not specified my application description . anyways I am using the asp.net mvc 2 with c# language .let me try this code
Lalit