You need to sign in to do that
Don't have an account?

lightning- field updated dynamically
Hello,
In my lightning page, I display a list of opportunities (data retrieved from the database). I need to update the data and save it. in my page, I have the field Amount, which is calculated automatically from the multiplication of 2 other fields.
Can you help me.

cmp file:
<aura:if isTrue="{!v.zonesList != null}">
<aura:iteration items="{!v.zonesList}" var="item" indexVar="index">
<div class="slds-col slds-size--1-of-6 slds-m-top_medium slds-m-left_xx-large">
<span><lightning:button label="{!item.name}" value="{!item.name}" aura:id="di" name="di" class="{!'customButton' +index+ ' slds-size--1-of-1 slds-p-horizontal_x-small'}" /></span>
</div>
<div class="slds-col slds-size--1-of-8 slds-m-left_small">
<span><lightning:input type="number" aura:id="{!index}" min="0" formatter="percent-fixed" step="0.01" name="globalObjective" label="" class="slds-p-horizontal_x-small" value="{!item.globalObjective}" /></span>
</div>
<div class="slds-col slds-size--1-of-6 slds-m-left_medium">
<span><lightning:input aura:id="{!index}" name="CA" label="" disabled="true" class="slds-size--1-of-1 slds-p-horizontal_x-small" type="number" formatter="currency" step="0.01" value="{!item.turnover}" /></span>
</div>
<div class="slds-col slds-size_1-of-12 slds-m-left_small">
<span>
<aura:if isTrue="{!index == 0}">
<lightning:input aura:id="{!index}" name="PerctNewbus" label="NB" class="slds-size--1-of-1 slds-p-horizontal_x-small" type="number" min="0" formatter="percent-fixed" step="0.01" value="{!item.newBusiness}" />
<aura:set attribute="else">
<lightning:input aura:id="{!index}" name="PerctNewbus" label="" class="slds-size--1-of-1 slds-p-horizontal_x-small" type="number" min="0" formatter="percent-fixed" step="0.01" value="{!item.newBusiness}" />
</aura:set>
</aura:if>
</span>
</div>
In my lightning page, I display a list of opportunities (data retrieved from the database). I need to update the data and save it. in my page, I have the field Amount, which is calculated automatically from the multiplication of 2 other fields.
Can you help me.
cmp file:
<aura:if isTrue="{!v.zonesList != null}">
<aura:iteration items="{!v.zonesList}" var="item" indexVar="index">
<div class="slds-col slds-size--1-of-6 slds-m-top_medium slds-m-left_xx-large">
<span><lightning:button label="{!item.name}" value="{!item.name}" aura:id="di" name="di" class="{!'customButton' +index+ ' slds-size--1-of-1 slds-p-horizontal_x-small'}" /></span>
</div>
<div class="slds-col slds-size--1-of-8 slds-m-left_small">
<span><lightning:input type="number" aura:id="{!index}" min="0" formatter="percent-fixed" step="0.01" name="globalObjective" label="" class="slds-p-horizontal_x-small" value="{!item.globalObjective}" /></span>
</div>
<div class="slds-col slds-size--1-of-6 slds-m-left_medium">
<span><lightning:input aura:id="{!index}" name="CA" label="" disabled="true" class="slds-size--1-of-1 slds-p-horizontal_x-small" type="number" formatter="currency" step="0.01" value="{!item.turnover}" /></span>
</div>
<div class="slds-col slds-size_1-of-12 slds-m-left_small">
<span>
<aura:if isTrue="{!index == 0}">
<lightning:input aura:id="{!index}" name="PerctNewbus" label="NB" class="slds-size--1-of-1 slds-p-horizontal_x-small" type="number" min="0" formatter="percent-fixed" step="0.01" value="{!item.newBusiness}" />
<aura:set attribute="else">
<lightning:input aura:id="{!index}" name="PerctNewbus" label="" class="slds-size--1-of-1 slds-p-horizontal_x-small" type="number" min="0" formatter="percent-fixed" step="0.01" value="{!item.newBusiness}" />
</aura:set>
</aura:if>
</span>
</div>

Sorry, what is the requirement?