function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sai prakash 14sai prakash 14 

how to write lightning:select in aura:iteration

i am trying to pass the data-id and data-value to javascript .but i am anuable to pass those values onchange event .please help me how to pass the values onchange event
<aura:iteration items="{!tableList}" var="set" indexVar="childindex">
                                <tr>
                                    <td>
                                        <ui:outputtext class="slds-align_absolute-center" value="{!childindex + 1}"> </ui:outputtext>
                                    </td>
                                    
                                    <td>
                                        <!--lightning:input variant="label-hidden" class="slds-align_absolute-center" disabled="true" name="Name" type="text"    value="{!set.field}" /-->
                                        <a style="color:black"   >
                                            <!--lightning:combobox aura:id="select_Field" name="FieldReference" label="FieldReference" placeholder="Choose any Field" variant="label-hidden" value="{!set.field}" options="{! v.headerOptions }" /-->
                                            <lightning:select   class="label-hidden" value="{!set.field}" data-id="{!masterindex}" data-value="{!childindex}" onchange="{!c.onHeaderChange}" >
                                                 <option text="Select any value" value=""/>
                                                <aura:iteration items="{!v.headerOptions}" var="Option">
                                                    <option text="{!Option.label}" value="{!Option.value}"/>
                                                </aura:iteration>
                                            </lightning:select>
                                            
                                        </a>
                                    </td>
 
Devi ChandrikaDevi Chandrika (Salesforce Developers) 
Hi Sai,
Please refer below links which might help you further
https://salesforce.stackexchange.com/questions/193359/how-to-pass-data-to-lightning-controllers-with-change-events
https://salesforce.stackexchange.com/questions/120854/passing-parameter-from-component-to-javascript-controller

Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.

Thanks and Regards
Jatin Sethi 26Jatin Sethi 26
I also have same query, as we are already in iteration. How to get lightning:select value for each row in iteration? Did you find anything?