18
Views
2
Comments
Solved
OnScrollEnding event in the list for Traditional web app
Application Type
Traditional Web

Hi Team,

Need help with adding a onScrollEnding event for a list in Traditional web application. If someone has an idea or a demo app which they can share, will be a great help for me.

Thanks in advance!

2023-02-19 11-04-52
Ritesh Ghate
Solution

Hi @Benjith Sam, I have used infinite Scroll component, and it suits my requirement.

Thanks for the reply.

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Ritesh,

It would be helpful if you could share a minimal version of what you have tried so far (OML) with the community so they can assist you with a solution.

Alternatively, you can follow the JS solution below for your use case: Register a scroll event for the list and implement logic to execute your business req when the end of the scroll is reached, as described below.

 Code Snippet:

 const listEle = document.getElementById('ListRecordsId');
    listEle.addEventListener('scroll', function(event) {
        const {scrollHeight, scrollTop, clientHeight} = event.target;
    
        if (Math.abs(scrollHeight - clientHeight - scrollTop) < 1) {
            alert('You have reached the end of the scroll!');
        }
    });

Demo app: OnScrollEndingDemo

I hope this helps you!


Kind regards,

Benjith Sam

2023-02-19 11-04-52
Ritesh Ghate
Solution

Hi @Benjith Sam, I have used infinite Scroll component, and it suits my requirement.

Thanks for the reply.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.