Toggle edit mode function

Toggle edit mode function

When you have a list with items it could be that you want to add a delete button to every row when in edit mode. It could be nice if there was some kind of "edit-mode" flag for a <li/> item which can be toggled by a button. Just a mockup:

  1. <ul id="lstItems">
  2.       <li>Item 1</li>
  3.       <li data-role="edit-mode">Item 1 <a href="#">delete</a></li>
  4.       <li>Item 2</li>
  5.       <li data-role="edit-mode">Item 2 <a href="#">delete</a></li>
  6.       ....
  7. </ul>
  8. <a href="$('#lstItems').toggleEditMode()">Toggle edit mode</a>


    • Topic Participants

    • bas