You need to sign in to do that
Don't have an account?
Francesca Ribezzi 2
problems with event.target - why is my object "undefined"?
Hi everyone,
I don't get why my sala in console.log sala.Name results "undefined".
Can anyone sort this out, please?
Thank you! :-)
I don't get why my sala in console.log sala.Name results "undefined".
Can anyone sort this out, please?
Thank you! :-)
<aura:attribute name="sale" type="Sala__c[]"/> <aura:attribute name="sala" type="Sala__c"/> <aura:iteration items="{!v.sale}" var="sala"> <li class="slds-dropdown__item" role="presentation"> <a href="javascript:void(0);" role="menuitem" tabindex="-1"> <span id="{!sala}" style="color: black;" class="slds-truncate" title="{!sala.Name}" onclick="{!c.onChange}" > {!sala.Name} </span> </a> </li> </aura:iteration> onChange : function(component, event, helper){ var sala = event.target.id; component.set("v.sala", sala); console.log("sala " + sala.Name); ...
Due to Improper Id you were facing this issue
Regards
Ashif
All Answers
Due to Improper Id you were facing this issue
Regards
Ashif
Thank you! I really appreciate your help, Ashif! :-))