Articles

Salesforce LWC: Pagination vs. Infinite Scroll vs. See more

Image
The idea for the three display methods as a carrier can deliver items. We assume that a delivery person can deliver 100 articles. The problem that his truck supports only 20 items. So you have to make 5 trips to deliver them all.  It's the same idea for LWC is split the data and display by batch. In our tutorial, we will see together how to display data with pagination, infinity scroll or see more button. Backend: Apex All display types share the same apex function. The principle of the function is to retrieve data with: Well-defined number of lines (With Limit). In our example, we will use 20 rows. Data recovery starting range   (With Offset) . T his value is modified according to the request. To start the implementation, we need two functions: Function to retrieve data (getAccountsList) Function to retrieve number