02.06.2013 Views

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

Pro PHP and jQuery by Jason Lengstorf.pdf - Computer Science ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

304<br />

CHAPTER 8 ■ EDITING THE CALENDAR WITH AJAX AND JQUERY<br />

Figure 8-8. Because the event no longer exists, the event view makes no sense<br />

Remove the Event from the Calendar After Deletion<br />

You want to avoid the confusion caused <strong>by</strong> having non-existent events on the calendar after a user<br />

deletes them, so you need to add functionality to remove events from the calendar once this occurs.<br />

To do this, you’ll add a new function to the fx object literal called removeevent. This function will use<br />

the active class applied to events when they’re brought up in the modal window to fade them out <strong>and</strong><br />

remove them from the DOM. You can add this function to fx using the following bold code:<br />

fx = {<br />

"initModal" : function() {...},<br />

"boxin" : function(data, modal) {...},<br />

"boxout" : function(event) {...},<br />

"addevent" : function(data, formData){...},<br />

// Removes an event from the markup after deletion

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!