question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Repeatable - know which row triggered the ajax request

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
pxpmcommented, Jan 12, 2021

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 the editable pivot fields #3410 in 4.1 (along with fixing the relationships) this becomes like a must in the field, otherwise it would break in very common scenarios I think (and then it would become a real bug).

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

0reactions
pxpmcommented, May 7, 2021

There is a PR for this already open. I am going to close this issue. #3439

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found