Tree List
<oge-tree-list> renders hierarchical data from a flat self-referencing array — every row points at its parent via parentIdExpr. Columns, templates, themes and configuration are the same building blocks the data grid uses.
keyExpr parentIdExpr autoExpandAll expandedRowKeys
flat id/parentId data sibling-scoped sorting
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { OgeColumn, OgeTreeList } from '@oge-ui/tree-list';
@Component({
selector: 'demo-root',
imports: [OgeColumn, OgeTreeList],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<oge-tree-list
[data]="org"
keyExpr="id"
parentIdExpr="parentId"
[autoExpandAll]="true"
>
<oge-column field="name" caption="Name" />
<oge-column field="title" caption="Title" [width]="140" />
<oge-column field="office" caption="Office" [width]="140" />
<oge-column field="headcount" caption="Reports" dataType="number" [width]="110" />
</oge-tree-list>
`,
})
export class Demo {
readonly org = [
{ id: 1, parentId: null, name: 'Aylin Koç', title: 'CEO', office: 'İstanbul', headcount: 4 },
{ id: 2, parentId: 1, name: 'Baran Ateş', title: 'VP Engineering', office: 'İstanbul', headcount: 2 },
{ id: 3, parentId: 2, name: 'Ceren Aksu', title: 'Team Lead', office: 'İzmir', headcount: 1 },
{ id: 4, parentId: 3, name: 'Deniz Ünal', title: 'Engineer', office: 'İzmir', headcount: 0 },
{ id: 5, parentId: 1, name: 'Elif Barış', title: 'VP Sales', office: 'Ankara', headcount: 0 },
];
}Notes
- Rows whose parent value equals
rootValue(defaultnull) become roots; rows with a missing parent followorphanPolicy(discardorpromoteToRoot). - Sorting is sibling-scoped: each level sorts within its parent, the hierarchy never breaks.
- Expansion is two-way bindable via
[(expandedRowKeys)]; keyboard users expand/collapse with →/← in the first column (RTL-aware). - The component ships full treegrid ARIA:
aria-level/aria-posinset/aria-setsize/aria-expanded.