Posts

Showing posts from April, 2022

Client Side Pagination in LWC Component

Image
 Hi Folks, Hope you all are well !! In this post, we are gonna implement a simple client side pagination. Making use of client side pagination is much more simple then having all logic into Apex Class and doing SOQL on each click of Pre and Next button. Let's simplify pagination in below steps :- Get all the result in single Apex call. Hold the main result to a object type variable which further will be used to process the logic on each pre/next button click. Decide how many records needed to show on the page. Process the logic for displaying default number of records and when click on pre and next button. Handle the logic when records on page got changed. for the pagination logic, we have created a separate (child component) which will takes some property from its parent component and will process it accordingly. (Reusability feature). paginationlwc.cmp <template>     <lightning-card title = {cardTitle} >         <div style = "height: 200px;" >