" /> " /> "/>

Choose the number of element per page (lines) showen automatically in a smart table

571 views Asked by At

I have a ng smart table

 <ng2-smart-table  [settings]="settings" [source]="sourceDemandeSoumise" (custom)="onCustomDemandeDetails()">

        </ng2-smart-table>

Everything is working perfectly but i just want to choose the number of lines showed when opening the page (3 or 5) . Now i have 10 lines showed at the begining with the ability of chaging it manually to 5 or 10 or 25 or 100. Thanks

1

There are 1 answers

0
Jose Carlos Estrada Garcia On

In your settings you can congigurate the pages per page like this:

pager: {
      perPage: 10,
    }

If you need custom this configurations per page you can update your settings configuration like this:

    settings = {

    pager: {
      perPage: 10,
    }
    }


   constructor(){
    }


    yourChangeMethod(numberOfPages:number){
    this.settings = {

        pager: {
          perPage: numberOfPages,
        }
    }
    }