Retrieve the table titles in order to display them as labels
Retrieve the table titles in order to display them as labels
Hello,
Is it possible to automatically retrieve the table titles in order to display them as labels in the creation and edition form, as well as in the bubbles?
<table>
<thead>
<tr>
<th>Número de orden</th>
<th>Cantidad</th>
</tr>
</thead>
</table>
fields: [
{
label: "order_number:",
name: "order_number",
},
{
label: "quantity:",
name: "quantity",
},
]
Indeed, with each modification, it must be renamed in two places, moreover my translations are done via PHP in the header of my table
Thank you
Answers
You can use jQuery for this or the api like in here:
I would assign ids to your <th> tags and use them as col selectors.
if you do what I suggested above you'll probably get this error:
Usually the Editor configuration runs before the Data Table's configuration because Editor is being referred to in the Data Table configuration (e.g. for the buttons). Hence you can't reference your Data Table in the Editor configuration.
So jQuery is the best and simplest option. Since your HTML is around prior to any kind of Editor and Data Table configurations it should work.