How can i pass parameters from lightning app component and access them in java-script controller where I can set or pass them to my event. Or is there a way out how i can know which attribute in my component was clicked inside my js controller. Actually I am iterating an array in my component and displaying all the iterations in tabular form setting dynamic ids to them, now when a user clicks an idem i want to pass its id and few more attributes to the controller, Can anyone help me with this.
Component
<aura:iteration items="{!v.all}" var="xxx">
<aura:if isTrue="{!xxx != v.search}">
<span class="sub_main_owner_icon">
<img aura:id="{!xxx}" onclick="{!c.loadDetails}" src="/Owner.png" />
</span>
</aura:if>
</aura:iteration>
Controller
loadDetails : function(component, event, helper) {
loadDetails.setParams({
**I want to pass values here from my component**
"xxx": component.get("v.xxx.Id")
"account": component.get("v.xxx.Id")
});
getSource
option might work. If you need more params, you may need to create your own special wrapper component with attributes that are set and then passed. The event handler would then be on the wrapper component, instead of this one. Sorry I don't have time to build out an example and show, but hopefully this comment sends you in the right direction.