I'm iterating over a list of Stores(Account) to display all the Stores assigned to an individuals. What I want to achieve is, from the list of Stores if one of list items (Store) is clicked/touched, it should display the details of that account. I have an Array of Store(Account) as an attribute in the component I'm iterating in.
<aura:attribute name="stores" type="Account[]"/>
<aura:iteration items="{!v.stores}" var="store">
<c:IndirectStoreCard store="{!store}"/>
</aura:iteration>
As you can see, I have created nested component(c:IndirectStoreCard) which encapsulate all the details of a store. My question is, how do I pass, the selected record i.e.Store to the JS controller. I know how to pass one of the fields (say, Id) to controller using anchor tag, but that would required me to query the other fields from the database and I don't want another database trip, simply because I already have all the data.So, I want pass the entire record.