Postponed on #3487726: FormElement tableselect is incompatible with #tabledrag
Contrib implementation in: #3487683: Add "Check all" functionality (switch to "tableselect") (also postponed on the core issue)
Problem/Motivation
OptionsButtonsWidget provides the
Check boxes/radio buttons
field widget.
Sadly, in contrast to EntityReferenceAutocompleteWidget those checkboxes / radios are not sortable, while they are still stored with delta value in the database already.
Switching to EntityReferenceAutocompleteWidget is not an option for UX reasons often, if you want to show all available options to the user.
So currently you don't have best of both worlds combined in the UI for the user as widget:
- Checkboxes / Radios
- Sorting
- (Bonus: Check all functionality - also see #3459246: Add a '#check_all' option for checkboxes element)
As Drupal already provides the wonderful tableselect FAPI element and already stores the delta in database, it should be relatively easy and benefitial to provide a "Sortable check boxes/radio buttons" widget in core.
Steps to reproduce
Proposed resolution
Provide a "Sortable check boxes/radio buttons" widget in core to allow not only (bulk) checking checkboxes option but also allow sorting the values (delta) if needed.
Remaining tasks
- Discuss
- Implement
- Test
- Release
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3487697
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
anybodyComment #3
anybodyComment #4
anybodyI tried implementing this in contrib first (Options Table module) but had to give up on this core issue: #3487726: FormElement tableselect is incompatible with #tabledrag
Comment #5
anybody