Posts Tagged ‘Filterfunction’
Flex cumulative Arraycollection.filterfunction
Earlier today I was working on some app @ boulevart
I had a datagrid containing a set of data, which i needed to be able to filter given various parameters.
I quickly found out that i could use the standard Arraycollection.filterfunction on the dataprovider to do so easily…
At least I thought
When applying only one filter on the dataprovider, this worked like a charm
It soon became clear that when you want to apply multiple filters at the same time, the whole dataprovider was passed to the second filter function instead of the already filtered dataprovider. With this, undoing the first filter and showing only the filter results of the last used filter.
I made my own “workaround” which involved some redundant and crappy coding ![]()
So the next step was some basic googling. It didn’t take long to find a solution by Cristian Rotundu. It can be found here
I like this solution because it enables flexibility by simply extending the standard flex Arraycollection and adding the functionality we need.
So it’s rather brilliant in its simplicity.
Two thumbs up for Cristian!
