Sticky Headers and FootersOpen
Keep grouped context pinned while scrolling through large grouped result sets.
Keep grouped context visible while scrolling through large grouped datasets.
Sticky group headers stay pinned at the top of the DataGrid scroll container. Sticky group footers stay pinned at the bottom and require grouped footers to be enabled.
Use these guides when grouping needs to work together with the rest of the grid workflow.
Set stickyHeaders on [groupable] to keep each visible group header pinned to the top of the scroll container while that group's rows remain in view.
<ngb-datagrid [groupable]="{ stickyHeaders: true }"></ngb-datagrid>
Set stickyFooters together with showFooter to keep grouped footer summaries pinned to the bottom of the scroll container while that group's rows remain visible.
<ngb-datagrid [groupable]="{ showFooter: true, stickyFooters: true }"></ngb-datagrid>
This example groups transaction records by account type and status, then keeps grouped headers and summary footers visible while you scroll through the dataset.
Loading interactive DataGrid example…
groupable: NgbDataGridGroupingSettings = {
showFooter: true,
stickyHeaders: true,
stickyFooters: true,
};
group: NgbDataGridGroupDescriptor[] = [
{ field: 'accountType', dir: 'asc', aggregates: this.aggregates },
{ field: 'status', dir: 'asc', aggregates: this.aggregates },
];
| API | Type | Usage |
|---|---|---|
NgbDataGridGroupingSettings.stickyHeaders | boolean | Pins visible grouped header rows to the top of the DataGrid scroll container. |
NgbDataGridGroupingSettings.stickyFooters | boolean | Pins visible grouped footer rows to the bottom of the DataGrid scroll container. |
NgbDataGridGroupingSettings.showFooter | boolean | Required when using sticky grouped footers because footer rows only render when grouped footers are enabled. |
[groupable] | boolean | NgbDataGridGroupingSettings | Pass an object to combine sticky grouped headers, sticky grouped footers, and grouped footers. |
showFooter because the grid only renders footer rows when grouped footers are enabled.Move between the overview, templates, aggregates, and sticky grouped row guides without losing context.
Start with local and manual grouping, shared state, and the base grouped grid flow.
Customize grouped headers, grouped cells, and grouped footer rows with public directives.
Add grouped totals, counts, averages, and min or max values to real grouped rows.
Keep grouped context pinned while scrolling through large grouped result sets.