-
Notifications
You must be signed in to change notification settings - Fork 916
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix for missing form fields in modal ajax call #2912
Conversation
Hi there! Could you please provide us with more info about this? Looks like you skipped the title/body. Thank you! -- |
The inspection completed: No new issues |
@tabacitu do you think this is something we can provide ? It would allow for example to add/remove fields from inline create modal based on some form input. I am just wondering, lot's of times (i think most of them) we don't want the full input of the form, rather 1/2/3 fields we are going to work on. Should we implement something along the lines:
By default |
Wow this looks like it would be useful indeed - thank you @dividy . @pxpm I think you're right - an option to pick-and-choose which fields to send over would be even better. That way you don't bloat up the InlineCreate form with ALL form fields, which might end up conflicting anyway (input names from the main form and input names from the inlineCreate form). Excellent idea! The one thing I'm pondering over though, from your suggestion @pxpm , is the position and naming of the attribute. Maybe: [ // relationship
'type' => "relationship",
'name' => 'tags', // the method on your model that defines the relationship
'ajax' => true,
'inline_create' => [
'entity' => 'tag',
'include_main_form_inputs' => true,
] // you need to specify the entity in singular
], What I'm saying is:
Other than that, I think this is an excellent feature already, great teamwork here! @dividy do you agree with the suggestions? Would you be interested in finishing up this feature, or should @pxpm or I schedule time to do it? Cheers! |
Agree with @tabacitu This should be pushed inside inline create definition array so we adhere to what it is really doing. EDIT: Also I vouche for fields instead of inputs. They are inputs technically speaking, they are backpack fields in our panels. 😄 |
Wow, awesome to hear that! Thanks a lot @dividy ! |
Totally understandable. I just had this started in my local branch so I just polished it and submitted the PR. If there is something more we can do to speed up your development process let us know, maybe it's a good backpack feature :) Wish you the best @dividy Pedro. |
Update: just merged #3013 which fixes this. It'll be available later today with a |
Update: sorry it looks like there might still be problems/inconsistencies with #3013 (comment) - at least the way I understand it. So this will NOT be available later today. |
This PR should be better than my previous one.
I'm trying to send the current form fields to the modal endpoint.
The code was already present in 2 other places in this file, so I integrated it in this ajax call too.