[Data Grid] How to implement server-side pagination?

Forge Component
(26)
Published on 31 Jul by OutSystems R&D
26 votes
Published on 31 Jul by OutSystems R&D

Hi folks, 


I'm trying to understand how server-side pagination can be implemented with the data grid component. 

Besides the obvious REST API method that needs to allow fetching a set of records given a page size and current index, can you please explain what else needs to be done with the component's Pagination web blocks?


Thank you!

I'd be interested in this as well. The grid is awesome but fairly slow on the initial load with a large data set. The same data set hooked up to an aggregate with pagination is much faster.

Hey guys,

Server Side pagination is not available out of the box in the Data Grid component. Nevertheless, it's possible to extend the underlying framework to achieve those results.

In order to have server side pagination, you'd need to redefine the initGrid function and, instead of initializing a CollectionView, initialize a ServerCollectionView. The easiest way to do it is to create a webblock that wraps all these initialization, and use it in the screen where your data grid lives.

You can get a better understanding of how the ServerCollectionView works here: https://demos.wijmo.com/5/SampleExplorer/SampleExplorer/Sample/ServerCollectionView.

In addition to this, you'd need to adapt all your server side logic to cope with the pagination.

Kind regards,

Ricardo Alves