I'm interested in adding a link in a tableselect form row. Utilizing the #options
key I can only add columns with strings. I am able to add form elements in the #options
array similar to the #rows
array.
$rows[$nid] = [
'edit_link' => [
'class' => 'edit_link',
'data' => [
'#type' => 'link',
'#url' => Url::fromRoute('group_manager.edit'),
'#title' => 'test',
],
],
]
//…
$form['table'] = array(
'#type' => 'tableselect',
'#header' => $header,
'#options' => $rows,
);
Implementing this example as is doesn't render this column in the table, so I assume it has failed somehow.
The 'edit_link' element works if the form is changed to a 'table' instead of 'tableselect'.