views:

6491

answers:

4

I am trying to integrate the jquery Full Calendar (http://arshaw.com/fullcalendar/) in my asp.net mvc application.

I need to use this full calendar to add/edit/delete/show the events using the sql server database as backend.

Do anyone have the sample code to implement the add/edit/delete events with this Full Calendar.?

+1  A: 
function createCalendar() {

    var d = new Date();
    var y = d.getFullYear();
    var m = d.getMonth();

    $('#calendar').fullCalendar({
       editable : false,
       events : 'urltoevents'
       aspectRatio : 1.5,
       header : {
        left : false,
        center : 'title',
        right : 'prev,next today'
       },
       eventClick : function(event) {
        handle the click event.
       }
      });

};

function removeEvent(id){
    $('#calendar').fullCalendar('removeEvents', id);
}

function updateEvent(id, title){
    var event = $('#calendar').fullCalendar('clientEvents', id);
    event.title = title;
    $('#calendar').fullCalendar('updateEvent', event);
}
lomaxx
Nice one. How can i add an event to the calendar? It'll be very nice if you give me a working copy of this calendar with the add/edit/delete events?
Prasad
+1  A: 

Hi Prasad did you got any example code of working copy of the Jquery Full calendar. I am also looking for a calendar for my php project that functions like booking the appointment from the patient for a doctor. I have the scheduled slots for the doctor in my database. Based upon the selected doctor the calendar should accept the appointments for a particular day. When the patients clicks on a particular day then I need to capture the patients information for the selected slot, also I need to validate whether the slot is available or not? Also I need to restrict the Patient in selecting the Off days, holidays etc... Also I need to specify the time interval of the slot. Please tell me if you found any code for such functionality or any other dynamic code that can be accessed to the database and mange such things with slight changes.

Sateesh
I didn't get any sample code except the one from lomaxx. I managed to build it on my own and moreover i did it in MVC (C#). If you can manage to handle in jquery, the below sample code may help.In the Event Click of the full calendar function, calladdEventShow(dayDate, allDay, jsEvent, view);
Prasad
function addEventShow(dayDate, allDay, jsEvent, view) { $('#btn_add_event').click(function(e) { //Get the Values from the controls here $.getJSON("/Events/AddEvent/?t=" + new Date(), { //Your paramerters for the function }, function(data) { if (data != null) { if (data == true) { $('#lblMessage').html("Your event created."); $('#calendar').fullCalendar('refetchEvents'); } } }); });}
Prasad
Thanks a lot for your reply. How can we pass these captured parameters to the php file that save to the database. please help me out in this. Should we call any php file in this Javascript funtion. If so how we need to specify that.Thanks in advance,Sateesh B.
Sateesh
I am not that much fluent in php. please look at how to implement jquery in php. may be that will be useful
Prasad
+1  A: 

Hi Prasad, I also need to develop fullcalender which intract with DB,Where user can add/edit/delete the event added.can you pls send me the MVC C# project to me.

Deep
Prasad pls provide me the working code how to intract fullcalender with database
Deep