TAILIEUCHUNG - apress pro php and jquery 2010 phần 9

Bước tiếp theo là xây dựng những ngày lịch thực tế. Một số bước cần phải được hoàn thành cho việc này để làm việc: 1. 2. Tạo một danh sách không có thứ tự mới. Thiết lập một vòng lặp (với một truy cập lặp đi lặp lại, truy cập ngày lịch, ngày hôm nay, và | CHAPTER 8 EDITING THE CALENDAR WITH AJAX AND JQUERY removeevent function Removes any event with the class active .active .fadeOut slow function this .remove . deserialize function str . urldecode function str . Modifying the Form Submission Handler to Remove Deleted Events To remove events after they are deleted add a new variable called remove to the form submission event handler. This will store a boolean value that tells the script whether to remove an event. By default this value will be set to false which means the event should not be removed. The only condition under which an event should be removed is if the Yes Delete It button is clicked from the confirmation dialog. Add a check for this text in the Submit button and set remove to true if a match is made. Inside the success handler set up a conditional that checks whether remove is true and fires if it is. Finally to prevent empty elements from being added to the calendar modify the conditional that fires to ensure that remove is false before executing. You can make these changes by adding the code shown in bold Edits events without reloading .edit-form input type submit .live click function event Prevents the default form action from executing Serializes the form data for use with .ajax var formData this .parents form .serialize Stores the value of the submit button submitVal this .val Determines if the event should be removed remove false If this is the deletion form appends an action if this .attr name confirm_delete Adds necessary info to the query string formData action confirm_delete confirm_delete submitVal If the event is really being deleted sets 305 CHAPTER 8 EDITING THE CALENDAR WITH AJAX AND JQUERY a flag to remove it from the markup if submitVal Yes Delete It remove true Sends the data to the processing file .ajax type POST url processFile data formData success function data If this is a deleted event removes it from the markup if remove true r .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.