GroupingCollection has a refresh method on it. Should do what you're looking
for (works for me).

On 10/22/07, reflexactions <[EMAIL PROTECTED]> wrote:
>
>   Thanks I will take a look.
>
> I seem to have found a work around for the moment, what I was doing
> was reset the source on the original GroupingCollection, calling
> refresh and then resetting the dataProvider.
>
> What seems to work is to create a new GroupingCollection each time
> instead of just updating the source
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, Scott -
> FastLane <[EMAIL PROTECTED]>
> wrote:
> >
> > The sample that I posted for you is using a HierarchicalData as the
> > dataProvider so there is some difference there. But, it still
> seems to
> > me like you are only missing an invalidate since your data shows up
> on a
> > column resize. To me that sounds like a missing
> > invalidateDisplayList(). I did notice a bug in JIRA re:
> > GroupingCollection and changes to underlying ArrayCollection a
> while
> > back... you might have a look there.
> >
> > Scott Melby
> > Founder, Fast Lane Software LLC
> > http://www.fastlanesw.com
> >
> >
> >
> > reflexactions wrote:
> > >
> > > Ah,
> > > I should have added that we are using a GroupingCollection rather
> > > than an ArrayCollection
> > >
> > > --- In [email protected] <flexcoders%40yahoogroups.com>
> > > <mailto:flexcoders% <flexcoders%25>40yahoogroups.com>, Scott -
> FastLane <smelby@>
> > > wrote:
> > > >
> > > > Hmmm... well, since a column resize ends up displaying the data
> it
> > > > certainly sounds like you are missing an invalidate. A couple of
> > > other
> > > > things to try: invalidateDisplayList on the grid, or refresh()
> on
> > > the
> > > > ArrayCollection after you alter the data. The following code may
> > > not be
> > > > optimal... but, it works every time regardless of whether I put
> > > zero
> > > > items into the ArrayCollection or actually have some items to
> put
> > > in
> > > > there. Note: I have to do a validateNow() for my resetting of
> the
> > > > scroll position to work. But, I don't think it is necessary
> > > otherwise.
> > > >
> > > > //save off the vertical scroll position
> > > > var vScrollPos:int =
> > > > this.contractElementsGrid.verticalScrollPosition;
> > > >
> > > > //put the elements from the contract into the array
> > > > collection
> > > > var tempElements:Array = new Array();
> > > > for each(var el:Element in modContract.elements)
> > > > {
> > > > tempElements.push(el);
> > > > }
> > > > this.contractElementsAC.source = tempElements;
> > > >
> > > > //refresh the array collection now that we have given
> > > it a
> > > > new source
> > > > this.contractElementsAC.refresh();
> > > >
> > > > //restore the scroll position
> > > > this.contractElementsGrid.validateNow();
> > > > this.contractElementsGrid.verticalScrollPosition =
> > > vScrollPos;
> > > > this.contractElementsGrid.invalidateDisplayList
> > > ();
> > > >
> > > >
> > > > hth
> > > > Scott
> > > >
> > > > Scott Melby
> > > > Founder, Fast Lane Software LLC
> > > > http://www.fastlanesw.com <http://www.fastlanesw.com>
> > > >
> > > >
> > > >
> > > > reflexactions wrote:
> > > > >
> > > > > Hmm didnt make any difference unfortunately.
> > > > >
> > > > > --- In [email protected] <flexcoders%40yahoogroups.com>
> > > <mailto:flexcoders% <flexcoders%25>40yahoogroups.com>
> > > > > <mailto:flexcoders% <flexcoders%25>40yahoogroups.com>, Scott -
> FastLane
> <smelby@>
> > > > > wrote:
> > > > > >
> > > > > > Have you tried AdvancedDataGrid.invalidateList() after you
> set
> > > the
> > > > > data?
> > > > > >
> > > > > > hth
> > > > > > Scott
> > > > > >
> > > > > > Scott Melby
> > > > > > Founder, Fast Lane Software LLC
> > > > > > http://www.fastlanesw.com <http://www.fastlanesw.com>
> > > <http://www.fastlanesw.com <http://www.fastlanesw.com>>
> > > > > >
> > > > > >
> > > > > >
> > > > > > reflexactions wrote:
> > > > > > >
> > > > > > > I am having an issue with the ADG.
> > > > > > >
> > > > > > > I have it set up and I load data into it say with 1 row
> and it
> > > > > > > displays fine ok...
> > > > > > >
> > > > > > > Then I load some data into it that is 0 length.
> > > > > > >
> > > > > > > The grid clears of data, again display fine ....
> > > > > > >
> > > > > > > Now I load some data in this time with say 1 row again.
> > > > > > > Nothing displays!!
> > > > > > >
> > > > > > > Load anything you like it wont display once it has been
> given
> > > 0
> > > > > > > length data.
> > > > > > >
> > > > > > > Now the really really odd things, use the mouse to
> strecth any
> > > > > > > column, and bingo the data displays.
> > > > > > >
> > > > > > > Now what I have seen is whilst the data "wont display"
> during
> > > the
> > > > > > > updateProprties the collection property shows length 0,
> the
> > > > > > > hierarchicalCollectionView gets set with the sourceModel
> > > which has
> > > > > > > length 1 but still the
> collection/hierarchicalCollectionView
> > > shows
> > > > > > > length 0 .......
> > > > > > > Then when I stretch the column, the
> > > > > > > collection/hierarchicalCollectionView goes to null at some
> > > point
> > > > > and
> > > > > > > then it is recreated and then when then the sourceModel is
> > > set it
> > > > > > > show length 1.
> > > > > > >
> > > > > > > Any ideas on how to fix this?
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>  
>

Reply via email to