You need to sign in to do that
Don't have an account?
Amit Behere
http://salesforce.stackexchange.com/questions/77730/lightning-component-auraiteration-is-throwing-error-upon-rerendering
Hello,
i am getting following error
Sorry to interrupt
This page has an error. You might just need to refresh it. Action failed: aura:iteration$controller$itemsChange [Cannot read property 'config' of undefined] Failing descriptor: {aura:iteration$controller$itemsChange}
config is not used in my JS then also i am getting the error
JS Code
in above js function i am getting error which i mention above
Component code
In any solution help me out....
i am getting following error
Sorry to interrupt
This page has an error. You might just need to refresh it. Action failed: aura:iteration$controller$itemsChange [Cannot read property 'config' of undefined] Failing descriptor: {aura:iteration$controller$itemsChange}
config is not used in my JS then also i am getting the error
JS Code
removeDeletedRow: function(component, event, helper) { // get the selected row Index for delete, from Lightning Event Attribute var index =event.getParam("indexVar"); //here i am getting exact index // var index= event.getSource().get("v.tabindex"); // var index=event.currentTarget.Dataset.index; console.log("index>>>>>>>>>>>>"+index); // get the all List (contactList attribute) and remove the Object Element Using splice method var AllRowsList = component.get("v.bookingList"); AllRowsList.splice(index, 1); // set the contactList after remove selected row element component.set("v.bookingList", AllRowsList); },
in above js function i am getting error which i mention above
Component code
<aura:iteration items="{!v.bookingList}" var="obj" indexVar="index"> <span> <tr class="slds-text-title_caps"> <td> <h1>{!index}</h1> </td> <td> <lightning:input class="slds-input" text="{!index}" name="{!'DES_'+index}" value="{!obj.Description__c}"/> </td> <td> <lightning:input class="slds-input" text="{!index}" name="{!'AMT_'+index}" value="{!obj.Amount__c}" required="true"/> </td> <td> <lightning:input type="checkbox" text="{!index}" name="{!'CHECK_'+index}" checked="{!obj.IsBooking__c}" onchange="{!c.updateAmount}"/> </td> <td> <lightning:input class="slds-input" text="{!index}" name="{!'GROSS_'+index}" value="{!obj.GrossAmount__c}" readonly="" /> </td> <td> <lightning:button tabindex="{!index}" value="{!index}" onclick="{!c.removeDeletedRow}" label="Delete"/> <a data-index="{!index}" onclick="{!c.removeRow}">Delete</a> </td> </tr> </span> </aura:iteration>
In any solution help me out....
A simple trick is to use: name
JS Code
removeRow is sufficient alone.
Alain Cabon,
Thanks for your help to solve the problem,
removeRow is sufficient alone is correct but my problem was different.
and i solved that "config undefiend" problem by just replacing the following
<lightning:input class="slds-input" text="{!index}" name="{!'DES_'+index}" value="{!obj.Description__c}"/>
with
<lightning:input class="slds-input" value="{!obj.Description__c}"/>
i.e. by removing the "name" and "text" property of "<lightning:input >" from my code because it is conflicting the aura iteration.