Hi Tanu,
In your Component if you are iterating a list of any object with input Checkbox field and you want to get values of selected checkbox on click of button:
<aura:iteration items=”{!v.AccountList}” var=”opp”>
<tr>
<td>
<ui:inputCheckbox class=”slds-checkbox” value=”{!opp.selected}” />
</td>
<td><ui:outputText class=”slds-output” value=”{!opp.Accc.Name}”/></td>
</tr>
</aura:iteration>
<ui:button class=”slds-button slds-button–neutral ” label=”Add” press=”{!c.addValue}”/>
JsController:
addValue : function(component, event, helper) {
var accProList = component.get(“v.AccountList”);
var selectedtLists = [];
for(var i=0;i<accProList.length;i++){
if(accProList[i].selected == true){
selectedtLists.push(accProList[i].Accc.Name);
}
}
}
In this you have to use wrapper class in your apex controller.if you are getting any problem than please let me know.
Thanks
-
This reply was modified 9 years, 3 months ago by
Satyakam.