<aura:iteration items="{!v.QliList}" var="Qli" indexVar="index">
<tr>
<td>
{!index + 1}
</td>
<td>
<c:lookupField
objectAPIName="US_DB_QLI__c"
label="{!index}"
returnFields="['Name']"
queryFields="['Name']"
selectedId="{!v.selectedId}"
filter="CreatedDate > 2001-01-01T00:00:01Z"
aura:id="QliName"
/> <lightning:input size="8" type="text" required="true" value="{!Qli.Name}" onclick="{!c.echo}"/> </td> </aura:iteration>
Java script controller:
echo: function(component, event, helper) {
let Index = event.getSource().get("v.name");
// var searchInput =component.get("v.QliList").find(row =>Index);
var searchValue = component.find("QliName").get("v.selectedId");
alert(searchValue);
var qlistring='v.QliList['+Index+'].Name';
component.set(qlistring,searchValue);
}
Is there any possible way to get value of (c:lookupField) by label defined by dynamic index label="{!index}"
in the above code i am getting same value for all iterated items. can someone help me in this regard.