12 Replies Latest reply on Aug 27, 2010 4:50 AM by JoshBeall

    What is the appropriate way to filter records displayed in a DataGrid?

    JoshBeall Level 1

      Hi All,

       

      I've got a DataGrid I'm using to display records to a user.  I want to give them some checkboxes to allow them to filter out different criteria.  For instance, "hide/show dropped members", "show only lifetime members", etc.

       

      My initial thinking was to attach an event listener that fires whenever a checkbox is checked/unchecked.  Additionally, there is an "original" ArrayCollection that contains all the records.  Everytime a checkbox is checked or unchecked, you can then loop over the "original" ArrayCollection, creating a new ArrayCollection that has only the records you want, and then you bind the DataGrid to that.

       

      Is this the right way to go about it?

       

        -Josh