Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I want to show "All" as an option in primeng p-table paginator

I have a primeng p-table, where I have [rowsPerPageOptions]="[10, 20, 30]", I also want to have an option which says 'All' on click of which it should display the entire row available in the table.

I tried this based on paginator component documentation. [rowsPerPageOptions]="[10, 20, { showAll: All }]"

but this does not help. https://www.primefaces.org/primeng/#/paginator

[rowsPerPageOptions]="[10, 20, { showAll: All }]"

expected: i shall be able to see 'All'

Please provide answer in this stackblitz https://stackblitz.com/edit/github-vmghz6-ytjegc?file=src/app/app.component.html

like image 761
Akash Bharati Avatar asked Sep 01 '25 03:09

Akash Bharati


2 Answers

One way i found is: [rowsPerPageOptions]="[10, 20, records.length]"

.ui-paginator .ui-dropdown .ui-dropdown-panel ul li:last-child {
  span::before {
    content: "All";
    visibility: visible;
  }
  span::after {
    content: "";
  }
  span {
    visibility: hidden;
  }

    }
like image 75
Akash Bharati Avatar answered Sep 02 '25 17:09

Akash Bharati


You're just missing the quotes around 'All':

[rowsPerPageOptions]="[10, 20, { showAll: 'All' }]"

like image 42
kshetline Avatar answered Sep 02 '25 17:09

kshetline