How can I implement InfiniteScroll with remote data

I react I want to implement InfiniteScroll with RemoteData binding

I have set pagesize to 25. On initialization of page, it fetch 25 records from server when user scroll to end grid and bind correctly

How can I implement ?

please help :)



1 Reply

RS Rajapandiyan Settu Syncfusion Team October 4, 2022 08:41 AM UTC

Hi Cuong,


Thanks for contacting Syncfusion support.


Query: I have set pagesize to 25. On initialization of page, it fetch 25 records from server when user scroll to end grid and bind correctly

How can I implement ?


To enable Infinite scrolling, set enableInfiniteScrolling property as true and inject InfiniteScroll module. Refer to the below documentation for more information.


InfiniteScroll: https://ej2.syncfusion.com/react/documentation/grid/infinite-scroll/#infinite-scrolling

By default, this feature loads three pages in initial rendering. But in your requirement, you want to load only first page on initial render. You can achieve this by setting infiniteScrollSettings.initialBlocks property as 1

InitialBlocks: https://ej2.syncfusion.com/react/documentation/grid/infinite-scroll/#initialblocks

We prepared a sample with remote data-binding and custom-binding for your reference. You can get it from the below link.


Remote data sample: https://stackblitz.com/edit/react-55r44j?file=index.js
custom data sample: https://stackblitz.com/edit/react-ywubwq?file=index.js

Please get back to us if you need further assistance.


Regards,

Rajapandiyan S
If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Loader.
Up arrow icon