Skip to content

Commit

Permalink
feat: Move showAll option to end (#17101)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwadrox authored Dec 25, 2024
1 parent e2b3f02 commit 1d6c1d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/primeng/src/paginator/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,19 @@ export class Paginator extends BaseComponent implements OnInit, AfterContentInit
updateRowsPerPageOptions(): void {
if (this.rowsPerPageOptions) {
this.rowsPerPageItems = [];
let showAllItem: SelectItem | null = null;

for (let opt of this.rowsPerPageOptions) {
if (typeof opt == 'object' && opt['showAll']) {
this.rowsPerPageItems.unshift({ label: opt['showAll'], value: this.totalRecords });
showAllItem = { label: opt['showAll'], value: this.totalRecords };
} else {
this.rowsPerPageItems.push({ label: String(this.getLocalization(opt)), value: opt });
}
}

if (showAllItem) {
this.rowsPerPageItems.push(showAllItem);
}
}
}

Expand Down

0 comments on commit 1d6c1d4

Please sign in to comment.