I've gone through Ionic 3 docs and I was trying to understand the difference between
https://ionicframework.com/docs/api/components/virtual-scroll/VirtualScroll/
and
https://ionicframework.com/docs/api/components/infinite-scroll/InfiniteScroll/
I see they use different components and while they show an example of InfiniteScroll there is no example of VirtualScroll and it's set up also looks trickier.
What is difference between the two and what are possible use cases when to use one or the other?
Infinite scrolling is a listing-page design approach which loads content continuously as the user scrolls down. It eliminates the need for pagination — breaking content up into multiple pages.
Virtual scrolling is widely used in large data grids that have hundreds of thousands or millions of rows and tens or hundreds of columns. In a virtual scrolling strategy, the total number of elements remains the same as the user scrolls, just that the current ones are replaced with the next ones.
Above all else, infinite scroll is designed to boost user engagement and keep viewers on the page for as long as possible. If visitors have no particular goal in mind, infinite scrolling will continue to roll out relevant content in a way that is efficient, digestible, and interruption-free.
Virtual Scroll displays a virtual, "infinite" list. An array of records is passed to the virtual scroll containing the data to create templates for. The template created for each record, referred to as a cell, can consist of items, headers, and footers.
Virtual Scroll
DOM
to display the list data that is currently on screen, and we recycle those DOM
elements to display new data as they scroll off
the screen.500
records to be displayed in a list, But Virtual Scroll
will only insert a percentage
of them into the DOM
at a time which makes scrolling more fluid
.This diagram should help explain the concept: (by courtesy of josh
article below)
Here you can see the example of Virtual Scroll
Infinite Scroll
Instance Members
than the Virtual Scroll
. That means you have more control of this component. Here is an example of Infinite Scroll
Refernces: Link 1 and Link 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With