title: FullCalendar, how do I allow users to edit/delete events and remove them from the database?
body: <p>I am having a little bit of trouble controlling the Full Calendar module as I would like. At the moment I have it so that the calendars getEvents method contacts an SQL table and returns all of the events for a user - that part works perfectly.</p>
  
  <p>The functionality I would like to add is to allow users to edit/delete events and have these changes be reflected in the database as they are made! By this I mean that in my table the user can drag and drop events to change their times, and when they click on an event, I wish for a dialog to appear asking them if they wish to delete this event. I would like these changes to be represented in the SQL table.</p>
  
  <p>How can I do this? I am new to JQuery, JavaScript and DatePicker. From my googling and attempts to learn, I have found a similar thread <a href="https://stackoverflow.com/questions/4649357/how-do-i-delete-this-event-from-fullcalendar">here</a> </p>
  
  <pre><code>function (calEvent) {
    removeRequestedEvent($(this), calEvent);
  },
  It just passes in the calendar event and the calendar itself.
  
  removeRequestedBooking: function (cal, calEvent) {
      if (!confirm("Delete?"))
          return;
  
      cal.fullCalendar("removeEvents", calEvent.id);
      cal.fullCalendar("rerenderEvents");
  
      // Re-show draggable element
      $("#requests #" + calEvent.id).show();
  }
  </code></pre>
  
  <p>which gives this code, which I believe is similar to what I need, however I wish to remove the event from the database when removeEvents is called. I assume I need some code similar to what I have when events are retrieved from the database (code shown below) but I am not sure how the code should be structured. Can anyone help me out with this ?</p>
  
  <pre><code>var db = Database.Open("users");
              var result = db.Query("SELECT * FROM events");
              var data = result.Select(x =&gt; new 
              {
                  id = x.id,
                  title = x.title,
                  start = x.start.ToString("s"),
                  end = x.end.ToString("s"),
                  allDay = false            
              }).ToArray();
  
              Json.Write(data, Response.Output);
              Response.ContentType = "application/json";
  </code></pre>