Do a search of the archives. It's HierachicalData that's the problem, it
eats the refresh events from the dp. Your search should turn up the code
posted for the solution.

 

Gk.

Gregor Kiddie
Senior Developer
INPS

Tel:       01382 564343

Registered address: The Bread Factory, 1a Broughton Street, London SW8
3QJ

Registered Number: 1788577

Registered in the UK

Visit our Internet Web site at www.inps.co.uk
<blocked::http://www.inps.co.uk/> 

The information in this internet email is confidential and is intended
solely for the addressee. Access, copying or re-use of information in it
by anyone else is not authorised. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
INPS or any of its affiliates. If you are not the intended recipient
please contact [EMAIL PROTECTED]

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tom McNeer
Sent: 17 September 2008 22:03
To: [email protected]
Subject: [flexcoders] Difficulty updating Grouping in Advanced DataGrid

 

Hi,

I am aware of the need to refresh the GroupingCollection within an
AdvancedDataGrid in order to display the data from the dataprovider.

But I'm having trouble firing the refresh at the right time.

In my application, an event is fired when a navigation choice is made.
The event switches the view, causing instantiation of the component
which contains the ADG. The event also initiates a service call to
retrieve data, which is then injected into an ArrayCollection in the
view component with the ADG.

I realize that the instantiation of the view and ADG may (or may not)
take place before the data is returned. So I have done two things: in my
ADG, I have placed a "refresh" of the GroupingCollection in the
"initialize" action of the ADG (as recommended in the docs). I have also
placed an eventListener on the ArrayCollection which is the
dataprovider, listening for a COLLECTION_CHANGE event.

Here's some code:

=================
            [Bindable]
            public var acJobsInProgress:ArrayCollection = new
ArrayCollection;
            private function init():void{
 
acJobsInProgress.addEventListener(CollectionEvent.COLLECTION_CHANGE,grid
Refresh);
            }
            
            private function gridRefresh(e:Event):void{
                divGrouping.refresh();
            }
=================

The gridRefresh function executes when the ADG is initialized, but the
underlying AC is empty -- not unexpected.

But the function is never fired again. I've set further breakpoints, and
I can see that the AC is being correctly populated from the service. But
the GroupingCollection is not refreshed.

I would expect that the COLLECTION_CHANGE listener would fire when the
AC is populated from the service. But it doesn't seem to.

Can someone please help me understand where I'm going wrong?


-- 
Thanks,

Tom

Tom McNeer
MediumCool
http://www.mediumcool.com <http://www.mediumcool.com> 
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560

 

Reply via email to