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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

■ CONTENTS<br />

Creating a Modal Window..................................................................................................................... 243<br />

Retrieve <strong>and</strong> Display Event Information with AJAX .............................................................................. 247<br />

Add a Close Button ............................................................................................................................... 253<br />

Add Effects to the Creation <strong>and</strong> Destruction of the Modal Window...................................................... 254<br />

Summary .......................................................................................................................262<br />

■Chapter 8: Editing the Calendar with AJAX <strong>and</strong> <strong>jQuery</strong>.......................................263<br />

Opening the Event Creation Form..................................................................................263<br />

Adding an AJAX Call to Load the Form ................................................................................................. 264<br />

Modifying the AJAX <strong>Pro</strong>cessing File to Load the Form......................................................................... 265<br />

Making the Cancel Button Behave Like the Close Button..................................................................... 268<br />

Saving New Events in the Database ..............................................................................269<br />

Modifying the AJAX <strong>Pro</strong>cessing File to H<strong>and</strong>le New Submissions ....................................................... 271<br />

Adding Events Without Refreshing ................................................................................273<br />

Deserializing the Form Data ................................................................................................................. 274<br />

Creating Date Objects........................................................................................................................... 279<br />

Appending the Event to the Calendar ................................................................................................... 283<br />

Getting the New Event’s ID................................................................................................................... 286<br />

Editing Events in a Modal Window.................................................................................290<br />

Determining the Form Action................................................................................................................ 291<br />

Storing the Event ID if One Exists ......................................................................................................... 292<br />

Remove Event Data from the Modal Window ....................................................................................... 294<br />

Ensuring Only New Events Are Added to the Calendar......................................................................... 296<br />

Confirming Deletion in a Modal Window........................................................................298<br />

Displaying the Confirmation Dialog ...................................................................................................... 298<br />

Configuring the Form Submission Event H<strong>and</strong>ler for Deletion ............................................................. 301<br />

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

Summary .......................................................................................................................307<br />

■PART 4: Advancing <strong>jQuery</strong> <strong>and</strong> <strong>PHP</strong>.....................................................................309<br />

ix

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

Saved successfully!

Ooh no, something went wrong!