• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2429
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

IT Degree with Certifications Included

Aspire to become a network administrator, network security analyst, or computer and information systems manager? Make the most of your experience as an IT professional by earning your B.S. in Network Operations and Security.

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