What's the type of your property pizza? Boolean? yes/no is not Boolean...
If you have Boolean values, you have to do like this..
private function processFilter(item:Object):Boolean {
return Boolean(item.value) == true;
}
Or... string values, yes/no values:
private function processFilter(item:Object):Boolean {
var isYes:Boolean = item.value == "yes" ? true : false;
return checkBox.selected == isYes;
}
Henrique F. Marino
http://blog.dclick.com.br
www.dclick.com.br
On Fri, Feb 13, 2009 at 2:34 PM, Haykel BEN JEMIA <[email protected]>wrote:
> Try this (not tested!):
>
> private var pizzaSelected:Boolean;
>
> private function pizzaFilter():void
> {
> pizzaSelected = pizza_ckb.selected;
> filterGrid();
> }
>
> private function filterGrid() :void
> {
> pizzaAr.filterFunction = myFilterFunction;
> pizzaAr.refresh();
> }
>
> private function myFilterFunction(item:Object): Boolean
> {
> return (item.pizza == pizzaSelected) ;
> }
>
> Haykel Ben Jemia
>
> Allmas
> Web & RIA Development
> http://www.allmas-tn.com
>
>
>
>
> On Mon, Feb 9, 2009 at 2:52 PM, johndoematrix <[email protected]>wrote:
>
>> hi i am trying to filter an array collection using a checkbox, but
>> when i select the check box all the data disappears. here is my filter
>> function
>>
>> private var pizzaSelected:Boolean;
>>
>> private function pizzaFilter():void {
>> if (pizza_ckb.selected == true)
>> pizzaSelected = pizza_ckb.data;
>> filterGrid();
>> pizzaAr.refresh();
>> }
>>
>> private function filterGrid() :void
>> {
>> pizzaAr.filterFunction=myFilterFunction;
>> pizzaAr.refresh();
>> }
>>
>> private function myFilterFunction(item:Object): Boolean
>> {
>> return
>> (item.pizza == pizzaSelected) ;
>> }
>>
>> then on my pizza_ckb checkbox on the click event i call
>> pizzaFilter(); is there something am doing wrong. if there is pizza
>> then the result is true and pizza records show if false nothing is
>> supposed to show up.
>>
>>
>
>