Get the Parent Component/ Layout of a Button?

One way to do is, using the Dynamic Component extension by @yusufcihan

For example,
You can create a table arrangement with suppose id= 1. Now inside that table arrangement, you can create a button with suppose id= btn1.
Now under Any Button. Click event, you will get the id of the clicked button. Here for example, button with id= btn1 is clicked, then now just replace the text ‘btn’ from the button id which will have only ‘1’ left with you, which is in-turn the id of the table arrangement in which the button resides.

Summary :point_down:

  1. You create a table arrangement with id=1

  2. Inside this arrangement, you create a button with id=btn1

  3. Now under the Any button. Click event, replace the text ‘btn’ with an empty text block from the text section in block editor.

  4. This will return you with id=1, which is in-turn an id of the table arrangement in which the clicked button is present.

This is the one way that I can think of. If you want, you can wait for more answer from other members. :slightly_smiling_face:

3 Likes