-
Notifications
You must be signed in to change notification settings - Fork 107
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
Form with related record editing #419
Comments
I've spend some time working on scenario like this:
that involved adding functionality to store atk4\data\Model References and their section layout within the \atk4\ui\View and also creating two new instances to interpret them
Goals:
What do you think of an implementation like this @romaninsh ?
|
@funyx As far as I understand @romaninsh has asked here what we need and proposes a solution to have 2 forms, but you propose to have 1 section of the standard form for fields and below another section for Reference fields. I like @funyx idea here. I just think for something in between i.e. extending the Form class by providing this ref editing functionality that @funyx is talking about. Maybe naming the new form something like WDYT think guys? |
Form can have multiple layout segments and if I am not mistaken then each segment can have separate model attached and all of them will be saved when form submits. Maybe that can help somehow here too? |
yup, that's the idea..
on form submit
|
Implemented by #700 |
I think this can be closed as the MultiLine FormField now exists. |
referenced in #784 |
Sometimes in the Form you want to also be able to edit related records.
Suppose you have "Inovice" model which "hasMany('Lines')". Each line contains "item_no", "item_name" as well as "price" and some other columns.
However, before you save the form, you cannot add items. This results in a difficult-to-implement UI.
My proposal is to implement this as extension to the form.
So here is what can be done:
This can be wrapped nicely into a Component that interract with form.
Additionally this can extend $form->save mechanics like this:
Alltogether this would be a powerful mechanism how to edit record along with it's related records. I think that multiple MultiLineForm components can be used to work on various related records.
This also makes possible to use many-to-many relations.
See also: #351
The text was updated successfully, but these errors were encountered: