Book Image

Mastering jQuery UI

By : Vijay Joshi
Book Image

Mastering jQuery UI

By: Vijay Joshi

Overview of this book

Table of Contents (19 chapters)
Mastering jQuery UI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Editing, deleting, and rearranging pictures


Before we code, let's see how the edit, delete, and rearrange operations will work.

On clicking on the edit icon, a dialog box appears with the image name in a text box. The user will edit this name and click on the Save button. Clicking on the Save button will send an AJAX request to a PHP script. The album ID, picture ID, and edited name will be sent to this script. Depending on the album ID and picture ID, the PHP script will change the name of said image in the original albums.json file.

Similarly, to delete an image, we will send the album id and picture id to the PHP script. The PHP script will delete the image from the original albums.json file.

To rearrange the sequence of images, we will get the current sequence on the page, which the user has made after reordering the images. We will send this sequence to the PHP script, and the script will update sequence values for each picture in album.

Editing a picture name

On clicking on the Save button...