• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2425
  • Last Modified:

How to filter Data in a Flex List component as the user type

I have list component with 800 data items. I want to filter the data as the user type on keyboard.

e.g if the user press letter "A" I want to filter the list data to only starting with A.

Any help on this?

Thanks
Vimal
0
VKN9876
Asked:
VKN9876
  • 2
1 Solution
 
zzynxSoftware engineerCommented:
* The dataprovider of your list is an ArrayCollection (of 800 items)
* Apply a filter function to that ArrayCollection.

I would start with a TextInput field where you can type in characters.

myCollection.filterFunction = myFilterFunction;
myCollection.refresh();

with

protected function myFilterFunction(obj:Object):Boolean {
      // here you return only true in case the first x characters equal the x characters typed in in your text field
}
0
 
zzynxSoftware engineerCommented:
Hi VKN9876, any questions left?
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now