You need to sign in to do that
Don't have an account?
d.tejdeep@nicomatic.in
I am using autocomplete textbox field in a dynamic add and remove records table i am copying value of <c:autocompletelwc to <lightning:input value="{!Qli.Name}
I can able set value dynamically to {!Qli.Name} But i cant to retrive value from the correcting to each row from <c:autocompletelwc
can some please help me in this above problem
Unable to copy dynamic value into aura:iteration lightning input field
<aura:attribute name="selectRecordName" type="String" description="text" ></aura:attribute> <aura:attribute name="selectRecordId" type="String" description="text" ></aura:attribute> <tbody> <aura:iteration items="{!v.QliList}" var="Qli" indexVar="index"> <tr> <td> {!index + 1} </td> <td> <div clas="slds-truncate" data-index="{!index}"> <c:autocompletelwc objectName="US_DB_QLI__c" fieldName="Name" selectRecordId="{!v.selectRecordId}" selectRecordName="{!v.selectRecordName}" onselected="{!c.selectedRecords}" aura:id="Qliname" /> Selected Record Name: {!v.selectRecordName} <br/> </div> <lightning:input size="8" type="text" required="true" value="{!Qli.Name}" onclick="{!c.echo}"/> </td> <td> <lightning:buttonIcon iconName="utility:add" size="large" variant="bare" alternativeText="Add" onclick="{!c.addRow}"/> <a onclick="{!c.removeRow}" data-record="{!index}"> <lightning:icon iconName="utility:delete" size="small" alternativeText="Delete"/> <span class="slds-assistive-text">Delete</span> </a> </td> </tr> </aura:iteration>
echo: function(component, event, helper) { //var ind = event.target.closest("data-index").dataset.value; // alert (ind); // var searchInput = component.find("Qliname"); // var searchValue = searchInput.get("v.selectRecordName"); let Index = event.getSource().get("v.name"); var qlistring='v.QliList['+Index+'].Name'; var searchValue= component.get("v.selectRecordName"); if(searchValue!=null){ component.set(qlistring,searchValue); } }, selectedRecords : function(component, event, helper) { var selectRecName = event.getParam('selectName'); var selectRecId = event.getParam('currentRecId'); if(selectRecName != undefined) { component.set("v.selectRecordName", selectRecName); component.set("v.selectRecordId", selectRecId); } }
I am using autocomplete textbox field in a dynamic add and remove records table i am copying value of <c:autocompletelwc to <lightning:input value="{!Qli.Name}
I can able set value dynamically to {!Qli.Name} But i cant to retrive value from the correcting to each row from <c:autocompletelwc
can some please help me in this above problem