Replies: 1 comment
-
Great, so this is more or less what I ask about here How to create recursive elements on a form ! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Suppose that a Company model hasMany Locations. Each Location has several fields (address, city, postcode, etc.)
On the edit screen for the Company model, I'd like to be able to manage these related Location records.
I should be able to:
Describe the solution you'd like
I would like a new field type – something like this:
Perhaps it could have additional methods, such as:
max(int $max)
: Specifies the maximum number of relations that can be added.confirmDelete(string $confirmation_prompt)
: Indicates that the user should be prompted for confirmation when deleting a record.When the form is submitted to the Screen handler, the request data should look like something like this:
The first two locations are examples of records that already existed in the database when the form was rendered. The third location (with a null ID) is an example of a record that was just created in the Repeater field by the user.
There may be better ways of approaching some of these things. This is just the gist of the idea.
Describe alternatives you've considered
There's this third-party package:
https://github.com/Nks/orchid-repeater-field
...but I'm hesitant to rely on a package that is so little-used. It seems like this functionality should be included in Orchid.
Beta Was this translation helpful? Give feedback.
All reactions