Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ datatable-scroller {
[hidden] {
display: none !important; // stylelint-disable-line declaration-no-important
}

datatable-summary-row.sticky {
position: sticky;
z-index: 99;

&.top {
top: 0;
}
&.bottom {
bottom: 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import { DataTableSummaryRowComponent } from './summary/summary-row.component';
>
@if (summaryRow && summaryPosition === 'top') {
<datatable-summary-row
[class]="stickySummaryRow ? 'sticky top' : ''"
[rowHeight]="summaryHeight"
[innerWidth]="innerWidth"
[rows]="rows"
Expand Down Expand Up @@ -207,6 +208,7 @@ import { DataTableSummaryRowComponent } from './summary/summary-row.component';
@if (summaryRow && summaryPosition === 'bottom') {
<datatable-summary-row
role="row"
[class]="stickySummaryRow ? 'sticky bottom' : ''"
[rowHeight]="summaryHeight"
[innerWidth]="innerWidth"
[rows]="rows"
Expand Down Expand Up @@ -355,6 +357,7 @@ export class DataTableBodyComponent<TRow extends Row = any> implements OnInit, O
@Input() verticalScrollVisible = false;
@Input({ required: true }) ariaRowCheckboxMessage!: string;
@Input({ required: true }) cssClasses!: Partial<Required<NgxDatatableConfig>['cssClasses']>;
@Input({ required: true }) stickySummaryRow!: boolean;

@Output() readonly scroll = new EventEmitter<ScrollEvent>();
@Output() readonly page = new EventEmitter<number>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
[rowDragEvents]="rowDragEvents"
[rowDefTemplate]="rowDefTemplate"
[cssClasses]="cssClasses"
[stickySummaryRow]="stickySummaryRow"
(page)="onBodyPage($event)"
(activate)="activate.emit($event)"
(rowContextmenu)="onRowContextmenu($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,11 @@ export class DatatableComponent<TRow extends Row = any>
*/
@Input({ transform: booleanAttribute }) enableClearingSortState = false;

/**
* When enabled it will keep the summary row always visible on top or bottom when scrolling.
*/
@Input({ transform: booleanAttribute }) stickySummaryRow = false;

/**
* Body was scrolled typically in a `scrollbarV:true` scenario.
*/
Expand Down
Loading