im building a list that people select only a single item which works in a limited capacity but reloading or re-selecting isnt very user friendly. the basic concept is a controller retrieves selections, uses aura iteration and displays a custom component for each selection. there are a couple of events that get thrown around, one of them when a selection is made. I capture the event in the main controller, now i want to loop through the selection list again and set which one is selected. im retrieving the list of things but it returns some weird array structure and im not sure how to navigate into it.
outer component:
Locations:
<ul class="slds-has-dividers_around-space">
<aura:iteration items="{!v.examinationApplicationType.events}" var="event">
<li class="slds-item">
<!--{!event.Name}-->
<c:Examination_Event aura:id="eventHolder" examEvent="{!event}" selected="{!event.Id == v.application.Examination_Event__c }"/>
</li>
</aura:iteration>
</ul>
exam event component
<aura:component>
<aura:attribute name="examEvent" type="Object" access="global"/>
<aura:attribute name="selected" type="Boolean" access="global"/>
ui stuff based on event and selected
event selected event handler
eventSelected: function(component, event, helper) {
console.log('event selected in main component');
//var map = component.get('v.map');
var my_event = event.getParam('event');
//console.log(my_event); //; returns proxy
//console.log(JSON.stringify(my_event)); // returns event as a string
var eventsInApp = component.find("eventHolder"); // get all events loaded as some array
console.log('eventsInApp');
console.log(eventsInApp);
for(var thing in eventsInApp){ // how do i look inside them?
console.log('thing');
console.log(thing);
var thisEvent = thing.getElement();
console.log(thisEvent);
}
component.set("v.event", my_event);
var eventType = component.get("v.eventType");
component.set("v.confirmString", "Confirm " + my_event.Name + " " + eventType);
},
console.log of iteration events
Proxy {0: a, 1: a, length: 2}
[[Handler]]
:
Object
[[Target]]
:
Array(2)
[[IsRevoked]]
:
false
weird array structure
?