Closed (fixed)
Project:
CheckboxesJS
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
2 Dec 2019 at 16:03 UTC
Updated:
18 Dec 2019 at 14:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
brooke_heaton commentedJust follow up, I think this really needs to be set in the widget settings so that it can be applied on a field-specific basis. Lacking that, the functionality is WAY too broad and assuming/destructive.
Comment #3
mlncn commentedYeah right now it's hard-coded to provide the Check All and Toggle buttons for any set of checkboxes with with more than five options.
I would very happily accept patches or merge requests to make the threshold number configurable (or do myself, that's trivial enough for me to do!).
If that's not sufficient, i would also welcome the functionality you request, putting this in the form widget display. I think i'd want this in an optional submodule, so the 80% use case ("give me a check all button if there are a lot of checkboxes") can be achieved without more third party settings pollution in the config or the UI.
Comment #4
brooke_heaton commentedAttached patch utilizes thirdPartySettings to allow each individual field to override the 'check all' functionality. This is provided in the form display field settings - unchecking the box and saving will remove the 'Check all' and 'Toggle' buttons from the field. This will keep existing functionality and all fields with options greater than 5 will have the 'Check all' UNLESS this checkbox is unchecked. This will preserve legacy functionality.
Comment #5
brooke_heaton commentedComment #7
mlncn commentedOK, it's committed!
I'll either learn to live with the third-party settings spamming every field, or if not i reserve the right to move this to a submodule.