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!
Hi @Benjith Sam, I have used infinite Scroll component, and it suits my requirement.
Thanks for the reply.
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