Sunday 15 February 2015

html - Reset a list using jQuery -


I have a list (id '#staff') that displays the names of employees stored in the database.

The user can open an editor that allows them to re-order, add and delete content, and then save or cancel their changes.

The saved function works.

My problem occurs when you make changes and click the Cancel button and then open the editor again, the changes still appear instead of being reset.

I have tried:

  $ ('# Staff') reset ();   

But that does not work.

I want to avoid using a page refresh.

How can I fix this problem?

When the page is first load, clone the list for future, then change the list Later with copy Click (function () {$ ('$') (value () ($ (function () {var my_copy = $ ('# list') .clone (true); $ ('# reset_button' #list '). Replace (with my_copy);});});

  • In the list Self. Click (function () {$ ('# list'). ('My_clone', $ ('#list ($ ('# List'). Replace (with $ ('# list'). Data ('My_clone'). });}}}}};

  • No comments:

    Post a Comment