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

Set a boolean value in a component
I have a flag in my Aura:if that allows me to add columns to my interface. I am able to access the controller, however, it does not appear to be updating the flag.
Component Code:
Any help wouldd be appreciated. The code is not displaying the second console.log statement but is displaying "made it here"
Component Code:
<aura:if isTrue="{!(not(v.showYear4))}"> <lightning:buttonIcon name="4" iconName="utility:add" title="Add Year 4" onclick="{!c.addColumn}" /> </aura:if> </th> <aura:if isTrue="{!v.showYear4}"> <th scope="col"> <span class="slds-truncate" title="YR4">Year 4</span> </th> </aura:if>Controller Code:
addColumn : function(component, event, helper){ console.log("made it here"); var currentTarget = event.currentTarget; var currentYear = currentTarget.getAttribute("name"); component.set("v.showYear"+currentYear,true); console.log("v.showYear"+currentYear); }
Any help wouldd be appreciated. The code is not displaying the second console.log statement but is displaying "made it here"
All Answers
Put a log for current Target and for current Year to see if that is working properly.
If it helps you please mark this as correct, it may help others.
in HTML
<lightning:buttonIcon name="4" iconName="utility:add" title="Add Year 4" onclick="{!c.addColumn}" aura:id="button4"/>
In Js controller