Is there any way to update only modified records in the list that is iterated through aura:iteration. I am trying to get index at row level using event.currentTarget
. But event.currentTarget is returning undefined. Is there any solution for this kind of scenario?
Below is my code pattern
Component
<table class="slds-table slds-table_bordered slds-table_cell-buffer week-table">
<aura:iteration items="{!v.roleWrappersByBR}" var="item" indexVar="index">
<tr class="hoursHover">
<td class="roles">
{!item.DS_Role} {!item.Duplicate_Role}
</td>
<aura:iteration items="{!v.weekJunctionWrappersByBR}" var="week1" indexVar="index2">
<td class="hours2" style="{!'background:' + week1.color+';padding:4px'}" data-value="{!index2}" data-row-index="{!index2}">
<ui:inputText class="hoursInput" value="{!week1.Hours}" label="{!index2}" updateOn="change" change="{!c.checkWeeksInput}"/>
</td>
</aura:iteration>
</tr>
</aura:iteration>
</table>
<ui:button label="Save Hours" press="{!c.SaveWeeks}"
class="slds-button" disabled="{!v.isReadOnly}"/>
Controller
checkWeeksInput : function(component,event,helper){
console.log('check values ',event.currentTarget,' -- ',event.getSource().get("v.value") );
}