wow Amy,
Some of your articles helped me a lot, realy thanks you:)
Now I looked at your example and using AdvacedDataModel with RmoteObject, 
getting the data from my Java code, couldnt rally see how can I use it 
(although I would love to), if you can guide me with the adaptations, please 
do...

I actaualy used your advice regards the AsyncToken, and I have some results, I 
get the data from the server, but I have lots of problem controlling the expand 
of the desired branch, when I click the branch, the data is fetched using the 
RemoteObject but childrens expand and collapse immidiatly :( 

My code:

in my mxml: 
1. I load first the data for the dataprovider to show only parents
2. When we click on the closed parentId we activate:

private function onItemOpen(event:AdvancedDataGridEvent ) : void
        {
       var remoteService:RemoteObject=getDataFromHandler();
       // getLazyData is the func from my server to get the data
       var news:AsyncToken = remoteService.getLazyData   
(event.item.GroupLabel);
      news.addResponder(new mx.rpc.Responder(setAttributes, onFault));
}

public function getDataFromHandler(): RemoteObject { 
        dataService = new RemoteObject("MyHandler1"); 
        dataService.showBusyCursor = true;                              
dataService.destination="DataGridRemote";
        return dataService;                     
} 

The RemoteObject goes to the server and when its back it activates:
protected function setAttributes(event: ResultEvent): void {
        var dm:DataModel;
        // my object from the server                            
        dm = DataModel(event.result);                                   model = 
MatrixDataModel(dm.model.getItemAt(0));
         // my function that converts my Object to DataProvider
        remoteDP = createProvider(model);                               // 
Create Headers
        createHeaders();
        // create upper group columns                           
        setGroupedColumns();
                
                        }

It sims that the correct data is on the grid but after a split sec it collapse.
WHY???
Can i use your code to make all better?

Thanks a lot for all your help, really

Jo

--- In [email protected], "Amy" <amyblankens...@...> wrote:
>
> --- In [email protected], "yossi.baram" <yossi.baram@> 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