Note: This package only works with zope.formlib (zope.app.form) and is not compatible with z3c.form.
You can use ListJsWidget for any schema.List field using the normal zope.formlib custom widget pattern:
from z3c.listjs import ListJsWidget ... form_fields['foo'].custom_widget = ListJsWidget
With the right ZCML override it should also be possible to automatically use this widget in all cases ListSequenceWidget would normally be used. Documentation contributions are welcome!
Should you wish to override the CSS for the buttons, the CSS classes are up_button and down_button. If you are using hurry.resource for your overriding CSS, your resource should depend on z3c.listjs.listjs_css so that ordering is correct to make the override happen.
If TinyMCE is installed, care is taken to disconnect TinyMCE editors before moving. Reconnection of the moved editors is assumed to take place in the included HTML for the new element, using something like:
tinyMCE.execCommand('mceAddControl', false, 'id_of_element');
A few small bugfixes:
- prefix is passed along to update_numbers
- attr is a local as it should be.
- getElementsByClassName actually filters by class name.
- Really fixed up/down arrow for added items.
- Fix bug where up/down arrows didn’t appear for newly added items.
- Allow moving individual list items up and down in the list.
- Initial public release.