I have a custom object named "abc" in which three fields are present. And i have also enabled "Add Notes and Attachments related list to default page layout" during this object creation. Hence i can now upload attachments for each record on this object.
What i want to do :
I want to create lightning component where i will show a list of records from the custom object and also list of attachments against each record.
What i have done till now :
I have created lightning component and fetched a list of records that i can show.
Problem i am facing :
How to show a list of attachments for each record? I want to show a downloadable link for each attachment. I am unable to do this.
Best Answer
on your client side markup you should define an attribute from the wrapper class, and have an aura:iteration for each record, and inside another aura:iteration for the attachments in each record:
Displaying the downloadable links - you can do in many ways - for example, I display download links like that (where
att
is the iteration variable):