[Bug] Repeatable - know which row triggered the ajax request
See original GitHub issueBug report
What I did
Setup a repeatable with ajax fields using include_all_form_fields
to manipulate the returned results based on form condition.
What I expected to happen
When user has for example 2 rows, I expect to have a way to know which of those rows triggered the request to the endpoint.
What happened
I can’t know which row triggered the ajax request.
What I’ve already tried to fix it
Nothing yet, but I think we can use the newly added backpack_field.parse_value
event in repeatable #3439 to add two hidden fields to the form, one with repeatable_name
and other with repeatable_row
so in the end we know which select
triggered the request. Maybe add another event backpack_field.parse_value_finished
that will remove those fields from the form again.
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version
the output is:
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
[Bug] Repeatable - know which row triggered the ajax request
When user has for example 2 rows, I expect to have a way to know which of those rows triggered the request to...
Read more >javascript - Ajax request repeating everytime - Stack Overflow
1 Answer 1 ... try to change the first condition "if(isset($_POST['size']))" to another one because this condition is always true.
Read more >jQuery Ajax Form Submit Repeating Problem/Questions
When a user enters their response that section "refreshes" using Ajax and an Ajax file (i.e. a different file for the same information...
Read more >105222 - Crashes on AJAX request callback functions - Monorail
1. I'm trying to debug an ajax call (fired via jquery) 2. Can't break on "success" fuction or "error" without crashing
Read more >xhr - DataTables
Additionally, as of DataTables 1.10.7 this event is triggered by both success and error conditions when the Ajax request completed (i.e. it is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @tabacitu I am not sure we should postpone this to 4.2. It’s not a BC, it’s atleast an
issue
that makes repeatable fields behave different than the others. And aiming at having theeditable pivot fields
#3410 in 4.1 (along with fixing the relationships) this becomes like amust
in the field, otherwise it would break in very common scenarios I think (and then it would become a realbug
).I plan to merge the other repeatable PR’s (rows, dependants etc) and only after tackle this one. And I think we are done with repeatable (atleast we gave it the functionality we support in other crud fields).
Rephrasing, what I think is that if we are going to put
repeatable
in the spotlights, we should make it work 100%, atleast in the scenarios we already are aware of.Let me know, Pedro
There is a PR for this already open. I am going to close this issue. #3439