--- In flexcoders@yahoogroups.com, "yossi.baram" <yossi.ba...@...> wrote:
>
> Hi guys,
> I am strugeling to figure out lazy loading in my AdvancedDataGrid.
> I didnt find any relevant document on that.
> If I'm using ItemRenderer for my columns to do manipulation on the data, it 
> is executed when I click on the grouped (branch )column.
> This is good if I ahve a dataprovider with all data.
> But if I want lazy loading,
> When or where should I create my RemoteObject to fetch the relevant data from 
> the server? 

I typically create a static class to use for the RemoteObject.  Each custom 
typed object in the collection has a reference to it and a method that can be 
called to tell it to load children.

> Can I do it in my ItemRenderer?
> Other option, If I catch a click from my AdvancedDataGrid and figure out the 
> parentId, and fetch the relevant data from the server, how can I activate the 
> Itemrenderer that I need to manipulate with this new data?

The dataProvider for your ADG will always be a HierachichalCollectionView, 
which means you can easily get from parent to child and vice versa.

If you start out with an empty ArrayCollection as the children property on each 
of your objects, then when that AC is updated (NOT REPLACED) by the result of a 
Remote Object call, then the AC should generate whatever events the ADG needs 
to fill itself in.

> Many questions regard this Lazy loading, can you guide me here please?

You might find this example helpful:

http://flexdiary.blogspot.com/2009/01/lazy-loading-tree-example-file-posted.html

HTH;

Amy

Reply via email to