<aura:component controller="valuesget"> <ltng:require styles="{!$Resource.slds + '/assets/styles/salesforce-lightning-design-system.css'}" /> <aura:handler name="init" value="{!this}" action="{!c.initmethod}" /> <aura:attribute name="AccountList" Type="List" /> <aura:attribute name="SelectedCity" Type="List" /> <aura:attribute name="selectedvalues" Type="List" />
<aura:component controller="valuesget">
<ltng:require styles="{!$Resource.slds + '/assets/styles/salesforce-lightning-design-system.css'}" />
<aura:handler name="init"iteration value="{!this}"var="a" action="items="{!cv.initmethodAccountList}" />
<aura:attribute name="AccountList" Type="List" />indexVar="indx">
<aura:attribute name="selectedvalues" Type="List" />
<ui:inputSelect class="slds-input"inputCheckbox aura:id="pick" change="text="{!ca.selectoptionvalueBillingCity}" >
<aura:iteration var="a" items="name="{!v.AccountListindx}">
<ui:inputSelectOption" label="{!a.BillingCity}" text="change="{!ac.BillingCityselectoptionvalue}" />
</aura:iteration>
</ui:inputSelect>
<aura:iteration items="{!v.selectedvalues}" var="account">
<article class="slds-card">
<div class="slds-card__header slds-grid">
<header class="slds-media slds-media--center slds-has-flexi-truncate">
<div class="slds-media__body slds-truncate">
<h2>
<a href="javascript:void(0);" class="slds-text-link--reset">
<span class="slds-text-heading--small">{!account.Name}</span>
</a>
</h2>
</div>
</header>
</div>
<div class="slds-card__body">{!account.BillingCity}</div>
</article>
</aura:iteration> </aura:component>
</aura:component>
Controller:
({
initmethod : function(component,event,helper){
var action = component.get("c.getAccountList");
action.setCallback(this,function(a){
var state=a.getState();
if(state == "SUCCESS"){
component.set("v.AccountList",a.getReturnValue());
}
}
});
$A.enqueueAction(action);
},
selectoptionvalue :function(component,event,helper){
var temp=component.get("v.selectedvalues");
var }selectedcity=component.get("v.SelectedCity");
var accountdetails = $Acomponent.enqueueActionget(action"v.AccountList");
}, temp = [];//empty when while changing Picklist value
if(event.getSource().get("v.value")){
selectoptionvalue selectedcity.push({'ids':functionevent.getSource(component).get("v.name"),'name':event.getSource().get("v.text"),helper'value':event.getSource().get("v.value")});
}
if(event.getSource().get("v.value") == false){
for(var temp=componentj=0;j<selectedcity.length;j++){
if(selectedcity[j].ids == event.getSource().get("v.selectedvalues"name");){
temp var index = [];//emptyj;
when while changing Picklist value }
var}
billingcity = component selectedcity.findsplice("pick"index,1);
}
component.getset("v.value"SelectedCity",selectedcity);
var accountdetails = component.get("v.AccountList");
for(var i=0;i<accountdetails.length;i++){
for(var k=0;k<selectedcity.length;k++){
if(accountdetails[i].BillingCity == billingcityselectedcity[k].name){
temp.push(accountdetails[i]);
}
}
}
component.set("v.selectedvalues",temp);
}
})
})