Ajax cannot be triggered from within a table row

Created on 10 November 2024, about 2 months ago

Problem/Motivation

Add a button in a form and the ajax callback works fine.
Move the button into a table row and ajax is not triggered

This is detailed further in this blog post: https://www.webomelette.com/ajax-elements-drupal-form-tables

Steps to reproduce

Create a button within a table row and add an ajax callback
No ajax is triggered and the button submits the page fully

Proposed resolution

Add ajax support for within tables

Remaining tasks

Merge request

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

Ajax is now supported within table rows.

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

ajax system

Created by

🇬🇧United Kingdom scott_euser

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @scott_euser
  • Pipeline finished with Failed
    about 2 months ago
    Total: 107s
    #334596
  • 🇬🇧United Kingdom scott_euser

    I added test coverage to demonstrate the issue. Needs an actual fix to the issue still.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 733s
    #334598
  • Pipeline finished with Failed
    about 2 months ago
    Total: 711s
    #334737
  • First commit to issue fork.
  • 🇮🇳India arunkumark Coimbatore

    Able to replicate the issue in my custom Form with Table.

    Try to debug the issue on the file RenderElementBase.php it seems that the Ajax button added inside the Table was not taking into the Ajax render element.

    Might be table parent elements causing this issue. I tested with other Form elements like LINK, and it was working fine. Updated the draft MR with the link field working.

    Unable to find any solution to fix, Need help in solving the issue.

  • Pipeline finished with Success
    about 1 month ago
    Total: 810s
    #344386
  • Geting the same problem on 10.x version

Production build 0.71.5 2024