Created
July 2, 2016 07:03
-
-
Save tyoshikawa1106/0ec0ce2a92f002c57046be70359f578e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component > | |
<aura:attribute name="item" type="Camping_Item__c" required="true" /> | |
<aura:attribute name="packed" type="Boolean" default="false"/> | |
<ui:outputText value="{!v.item.Name}" /> | |
<ui:outputCheckbox value="{!v.item.Packed__c}" /> | |
<ui:outputCurrency value="{!v.item.Price__c}" /> | |
<ui:outputNumber value="{!v.item.Quantity__c}" /> | |
<ui:button label="Packed!" press="{!c.packItem}" disabled="{!v.Packed}" /> | |
</aura:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
packItem: function(component, event, helper) { | |
var a = component.get("v.item",true); | |
a.Packed__c = true; | |
component.set("v.item",a); | |
var btnClicked = event.getSource(); | |
btnClicked.set("v.disabled",true); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment