Objects list: Add tree group by option to DataTables UIBlock

This commit is contained in:
Molkobain
2026-04-26 15:14:06 +02:00
parent 7f9f9a528e
commit 2d39cc6e93
4 changed files with 493 additions and 3 deletions

View File

@@ -631,6 +631,14 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory
$aExtraParams['table_id'] = $sTableId;
$aExtraParams['list_id'] = $sListId;
// Tree grouping options
if ($bIsTreeGroupingView) {
$sFirstAlias = array_key_first($aAuthorizedClasses);
$aOptions['sTreeGroupingAttr'] = $sTreeGroupingAttr;
// The JS reads the parent ID from this data key in each row
$aOptions['sTreeGroupingParentKey'] = $sFirstAlias.'/'.$sTreeGroupingAttr.'/raw';
}
$oDataTable->SetOptions($aOptions);
$oDataTable->SetAjaxUrl(utils::GetAbsoluteUrlAppRoot()."pages/ajax.render.php");
$oDataTable->SetAjaxData([