Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > <aura:attribute name="DataList" type="List" /> <aura:attribute name="FilteredDataList" type="List" /> <lightning:select name="Picklist" label="Status" onchange="{!c.onChange}"> </lightning:select> </aura:component> js Controller: ({ onChange: function (cmp, event, helper) { var selPickListValue = event.getSource().get("v.value"); var filteredList=[]; var dataList = component.get("v.DataList"); for(var i=0;i<dataList.length;i++){ if(dataList[i] == selPickListValue) filteredList.push(dataList[i]); } if(filteredList.length>0) component.set("v.FilteredDataList",filteredList); } })
You can filter the list and show the filtered list in the UI like this:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com
Thanks for the reply.
What about the controller class? and i said i need consume with out an object.