Datagrid pagination event

Hi,

I wanted to get the pagination details like current page when user clicks on any pagination number. so that i can cache it and reload the same pagenumber when user comes back to the datagrid page.

I was hoping to see some output emitter for pagination. but i dont see it in documentation. So wanted to check if its there and not documented or is it not implemented yet? if not then, i would request to provide one which will be helpful.

Thanks
Bishan

While it might make sense to have such an event being created on change of current page in the data grid, you could also cache the information about the current pagination in your component, which implements the data grid, when it is getting destroyed using the OnDestroy lifecycle hook. Just get the instance of the data grid @ViewChild(DataGridComponent, { static: false }) dataGrid: DataGridComponent; and in ngOnDestroy() get the pagination this.dataGrid.pagination to cache it for the user.



Christian Guether

2 Likes

Thanks Christian. It works.



Bishan T Prasad

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.