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.
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
}