You need to sign in to do that
Don't have an account?
Javier Castro
limit aura iteration
Hi everyone.
I hope you can help me. I'm working with a lightning component which has an aura iteration with another component inside.
My code:
I would like to know if there is any way to limit the number of records displayed and make a kind of button to load more or show more like in list views or related lists because when I have very few records I have no problem but when I have many records I get a very long vertical scroll and this is I want to avoid.
Regards
I hope you can help me. I'm working with a lightning component which has an aura iteration with another component inside.
My code:
<aura:iteration var="event" items="{!v.events}"> <c:LC_Events event="{!event}"/> </aura:iteration>
I would like to know if there is any way to limit the number of records displayed and make a kind of button to load more or show more like in list views or related lists because when I have very few records I have no problem but when I have many records I get a very long vertical scroll and this is I want to avoid.
Regards
Yes there is a way to limit the number of records to be displayed in aura:iteration.
Please find the below code:
By default size is 2.
After clicking on load more button.
Kindly let us know, if it helps you.
Thanks & Regards,
Vijay
All Answers
I trust you are doing splendidly and enjoying the season.
Please refer to the below blog by Sara Morgan which might help you with the above requirement.
https://saramorgan.net/2017/08/13/lightning-best-practice-adding-pagination-to-lists/
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Thanks for the response
I dont have enough time to implement it now but it seems a great solution for my problem.
Yes there is a way to limit the number of records to be displayed in aura:iteration.
Please find the below code:
By default size is 2.
After clicking on load more button.
Kindly let us know, if it helps you.
Thanks & Regards,
Vijay
I will try to implement that later today and I will tell you later.
Regards