Kurzes Update aus dem TYPO3 Slack:
Ich löse das Problem in TYPO3 v13 erstmal über eine XCLASS.
class DatabaseRecordListXclass extends \TYPO3\CMS\Backend\RecordList\DatabaseRecordList
{
public function renderListRow($table, array $row, int $indent, array $translations, bool $translationEnabled)
{
$html = parent::renderListRow($table, $row, $indent, $translations, $translationEnabled);
if ($table !== 'xxx') {
return $html;
}
$classes = [];
$record = BackendUtility::getRecord($table, $row['uid']);
if ($record['field1'] === 1 ) {
$classes[] = 'table-success';
}
if ($classes === []) {
return $html;
}
$html = preg_replace(
'/<tr([^>]*)class="([^"]*)"/',
'<tr$1class="$2 ' . implode(' ', $classes) . '"',
$html,
1
);
return $html;
}
}
Laut Stefan Bürk sollte es in v14 dafür ein passendes Event geben (da kann man die "tag attributes fürs tr mitgeben):
https://review.typo3.org/c/Packages/TYPO3.CMS/+/89941/16/typo3/sysext/core/Documentation/Changelog/14.2/Feature-107003-AddEventToChangeRecordDataInListView.rst
Ich würde das Thema daher erstmal als gelöst markieren 🙂