Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <aura:component>
- <aura:attribute name="fieldApiNames" type="List" />
- <aura:attribute name="showSpinner" type="Boolean" default="true" />
- <aura:if isTrue="{!v.showSpinner}">
- <lightning:spinner alternativeText="Loading..." />
- </aura:if>
- <lightning:recordEditForm onload="{!c.handleLoad}" objectApiName="Account">
- <lightning:messages />
- <lightning:layout multipleRows="true">
- <aura:iteration items="{!v.fieldApiNames}" var="api">
- <lightning:layoutItem aura:id="formItems" size="6">
- <div aura:id="top-div" />
- <lightning:inputField aura:id="field" fieldName="{!api}" />
- <div aura:id="bottom-div" />
- </lightning:layoutItem>
- </aura:iteration>
- </lightning:layout>
- </lightning:recordEditForm>
- <lightning:button title="Show Field Values" onclick="{!c.handleButton}" />
- </aura:component>
- ({
- handleLoad : function(cmp, evt, helper) {
- cmp.set( "v.showSpinner", false );
- },
- handleButton : function(cmp, evt, helper) {
- var first = cmp.get("v.fieldApiNames")[0];
- cmp.find("formItems").forEach( function(item) {
- alert( item.find("field").get("v.value") ); <== ?
- } );
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement