Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Angular Ag-Grid Display Pagination Panel After Certain Limit

I’m using ag-grid to construct the grid config and displaying the grid as per config.

Now, the grid has pagination but its on (displaying pagination panel) since pagination: true property is configured.

Is it possible to display pagination panel once maximum number of rows overflows.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So for example I add some mock property "limit":10 – pagination panel shouldn’t be visible till 10 so if 11 row is added add the pagination panel .

I checked ag-grid documentation, didn’t find anything, Is this possible to achieve?

>Solution :

You have to make pagination value dynamic based on your records.

HTMl file

<ag-grid-angular
    [pagination]="pagination"
    [paginationPageSize]="paginationPageSize"
    [paginationPageSizeSelector]="paginationPageSizeSelector"
    [rowData]="rowData"
</ag-grid-angular>

ts file

pagination: boolean = false;

You have to check numbers of records, and based on that you can set your limit to display pagination.

if (this.rowData?.length > 10){
    this.pagination = true
}else{
    this.pagination = false
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading