# Datagrid pagination event

**URL:** <https://community.cumulocity.com/t/datagrid-pagination-event/1257>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [March 21, 2024, 5:29am UTC](https://community.cumulocity.com/t/datagrid-pagination-event/1257 "2024-03-21T05:29:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bishan\_T\_Prasad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bishan\_T\_Prasad](https://community.cumulocity.com/u/Bishan_T_Prasad)\
**Post date:** [March 21, 2024, 5:29am UTC](https://community.cumulocity.com/t/datagrid-pagination-event/1257/1 "2024-03-21T05:29:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Christian\_Guether1](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/christian_guether1/32/14848_2.png) [@Christian\_Guether1](https://community.cumulocity.com/u/Christian_Guether1)\
**Post date:** [March 21, 2024, 9:05am UTC](https://community.cumulocity.com/t/datagrid-pagination-event/1257/2 "2024-03-21T09:05:18Z")

</div>

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

[Software AG Professional Services](https://www.softwareag.com/en_corporate/resources/services/professional-services.html)

[![](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/c/3/c3a93a2618e4708f51be40fe2e142061f7c4edc7.jpeg)](https://www.softwareag.com/en_corporate/resources/services/fast-track-services.html)

---

<div class="post-metadata">

**Author:** ![Bishan\_T\_Prasad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bishan\_T\_Prasad](https://community.cumulocity.com/u/Bishan_T_Prasad)\
**Post date:** [April 2, 2024, 5:16am UTC](https://community.cumulocity.com/t/datagrid-pagination-event/1257/3 "2024-04-02T05:16:16Z")

</div>

Thanks Christian. It works.

  

* * *

Bishan T Prasad

[Software AG Professional Services](https://www.softwareag.com/en_corporate/resources/services/professional-services.html)

[![](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/c/3/c3a93a2618e4708f51be40fe2e142061f7c4edc7.jpeg)](https://www.softwareag.com/en_corporate/resources/services/fast-track-services.html)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [September 29, 2024, 5:16am UTC](https://community.cumulocity.com/t/datagrid-pagination-event/1257/4 "2024-09-29T05:16:40Z")

</div>

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