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

[FEATURE] Add repeatable rows #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

thommyhh
Copy link

The extension was a great starting point, I found the behaviour of duplicating the whole container quite strange. So I decided to improve it - from my point of view - by introducing an extra level, the RepeatableRow. With this change, the elements configured are wrapped inside a RepeatableRow first. The row is then duplicated.

This changed behaviour was inspired the the Symfony Forms Collection type, which indeed is a very useful extension to the TYPO3 form framework.

I've also adjusted - or more completely rewritten - the javascript code. It does not depend on jQuery or any other framework anymore and comes with two variants:

  • A pure implementation which exposes the functionality to the global namespace
  • A bundle which already handles the initialization

I updated the README, so please take a look at https://github.com/webcoast-dk/repeatable_form_elements/tree/feature/add-repeatable-rows

Because of those drastic changes, I see this as a v3.0.0.

I hope this contribution is appreciated. I'm open for questions and discussion, either here or in the TYPO3 slack (@Thorben Nissen)

* add `RepeatableRow` form element
* adjust `FormHooks` to repeat rows instead of container
* add new javascript for repeating rows
  * add build process using webpack
  * add build to globally expose `RepeatableContainer` class
  * add bundled build, which already handles initialization
* split JS includes into seperate TypoScript files
* adjust repeatable container template
* remove deprecated style sheet
* raise version to `3.0.0`
* update README
@chrosey
Copy link
Collaborator

chrosey commented Jul 29, 2024

Thanks for your efforts @thommyhh.

As far as I understand, your underlying idea is not to copy the “Repeatable Container”, but the “Repeatable Row” inside it.

This approach is further nesting in my view. For me, the “Repeatable Container” already corresponds to what I understand from you as “Repeatable Row”. I could currently achieve the same goal by creating a “Fieldset” in the form editor and a “Repeatable Container” in it. The difference for me is the naming.

Have I understood your approach correctly or what is the deeper idea here?

@chrosey chrosey added the question Further information is requested label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants