toggle

An article by Gaspard Bucher

display a toggle checkbox

  1. action
  2. ajax
  3. API
  4. classes
  5. common attributes
    1. ..._if
    2. actions
    3. anchor
    4. attr
    5. date selection
    6. draggable
    7. eval
    8. label
    9. link params
    10. name
    11. prefix
    12. publish
    13. set_...
    14. status
    15. store
    16. text, t
    17. tlabel
    18. toggle
  6. conditions
  7. context
  8. dates
  9. display
  10. forms
  11. i18n
  12. meta
  13. SQLiss
  14. urls

Example to toggle in a table listing.

<table do='contacts in site'>
  <tr do='each' toggle='favorite' for='visitor.node'>
    <td do='link'/> <td do='postal_code'/> <td do='city'/>
  </tr>
</table>

css

The “toggle” element receives a ‘toggle’ class and a checkbox is inserted with Javascript. The “toggle” element also receives an ‘on’ or ‘off’ class that changes when the user clicks.

toggle example

If the toggle element is a table row (tr), the first cell receives the checkbox.