Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update editable table options to allow finer configuration around add, reorder, delete #10163

Merged
merged 6 commits into from
Dec 4, 2021

Conversation

nfourtythree
Copy link
Contributor

@nfourtythree nfourtythree commented Nov 25, 2021

Description

This PR adds finer grain control over when the add, reorder and delete controls are shown.

Currently, the staticRows property is the main factor in determining when the reorder handle and delete buttons. In its original state, this meant that it was not possible to have a table that simply allowed the addition and deletion of rows but not reordering

staticRows has been dropped in favour of three new properties allowAdd, allowReorder and allowDelete. These boolean properties are self-explanatory when it comes to the functionality they enable/disable. The defaults for these settings are false so when nothing is passed no additions, reordering or deletion will be allowed, this is a slight change in behaviour from version 3.

Checklist

  • Keep default behaviour if nothing is passed
  • Respect the static option to display as a "static" field
  • Check internal uses of the field macro and update with new parameters (where required)
  • Check internal uses of CP helper method and update with new parameters (where required)
  • Update changelog
  • Upgrade documentation

@nfourtythree nfourtythree self-assigned this Nov 25, 2021
nfourtythree and others added 4 commits November 30, 2021 08:57
# Conflicts:
#	src/web/assets/cp/dist/js/Craft.min.js
# Conflicts:
#	src/web/assets/tablesettings/dist/TableFieldSettings.js
#	src/web/assets/tablesettings/dist/TableFieldSettings.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants