No, I never call refresh(). Here's the sequence:

1) Set the filter function.
2) Add a parent object [filter function is not called]
3) Add a child object [filter function IS called]

I've tried adding parents and children later on too, and the filter 
function is still only called for children.


--- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote:
>
> 
> "and both are called after the filter is defined"
> 
> Are you calling ArrayCollection.refresh() after you finish adding 
the
> parent and children objects?
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "whatabrain" <junk1@> wrote:
> >
> > My filter function is really simple. Something along these lines:
> >
> >
> > private function filterFunc(item:Object):Boolean
> > {
> > return item is ChildObj;
> > }
> >
> > The dataProvider is an ArrayCollection containing ParentObjs.
> > ParentObj extends ArrayCollection, and contains ChildObjs.
> >
> > I call ArrayCollection.addItem() to add either ParentObj or 
ChildObj
> > to the tree, and both are called after the filter is defined. In
> > fact, I call the ChildObj insert right after the ParentObj insert.
> >
> > Basically, I want to hide all top-level nodes in the tree, but the
> > filter function isn't even called for those nodes.
> >
> >
> >
> > --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote:
> > >
> > >
> > > Interesting, I would think that the opposite would occur; if 
you're
> > > using something like: return item.myfield=="whatever";. Sure, 
post
> > your
> > > filterFunction; as well as a basic idea of the collection's
> > structure.
> > >
> > > -TH
> > >
> > > --- In flexcoders@yahoogroups.com, "whatabrain" <junk1@> wrote:
> > > >
> > > > When I try this, the filter function isn't called for top-
level
> > > > items. It's called for all child nodes in the dataProvider, 
but
> > not
> > > > for the parent node. Any idea why this might be, or do you 
need a
> > > > code sample?
> > > >
> > > >
> > > >
> > > > --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote:
> > > > >
> > > > >
> > > > > ICollectionView or a filterFuncton can work for this; if you
> > don't
> > > > want
> > > > > to mess with the underlying source.
> > > > >
> > > > > -TH
> > > > >
> > > > > --- In flexcoders@yahoogroups.com, "Tracy Spratt" <tspratt@>
> > wrote:
> > > > > >
> > > > > > Well, you "hide" a row by removing it from the 
dataProvider.
> > > > There is
> > > > > > no direct relationship between a DG row and a dataProvider
> > item.
> > > > > >
> > > > > > Tracy
> > > > > >
> > > > > >
> > > > > >
> > > > > > ________________________________
> > > > > >
> > > > > > From: flexcoders@yahoogroups.com
> > > > [mailto:[EMAIL PROTECTED]
> > > > > On
> > > > > > Behalf Of whatabrain
> > > > > > Sent: Thursday, September 04, 2008 8:36 PM
> > > > > > To: flexcoders@yahoogroups.com
> > > > > > Subject: [flexcoders] Hiding a row in an AdvancedDataGrid
> > > > > >
> > > > > >
> > > > > >
> > > > > > How do you hide a row in an AdvancedDataGrid? I can't 
find any
> > > > method
> > > > > > that lets you get a row by index or item.
> > > > > >
> > > > >
> > > >
> > >
> >
>


Reply via email to