PDA

View Full Version : AdvancedDataGrid Tree Help


samsonkiran
01-02-2009, 04:15 PM
Hi

I have advanceddatagrid in which i am displaying the data in Tree structure. Since the data is huge and it is taking lots of time to retrieve from databse, we wanted build the tree dynamically. Means initially we want to display the tree only will the parent nodes. Only when the user expands the parent node, we need to build the children node of this parent node (only when the user expands the parent node, we go to DB and retrieve the children node details). Is it possible to do this with FLEX advanceddatagrid tree structure. First i would like to know, is it feasible to do? if yes, then how to do it. It is very urgent.

Any help is appreciated. Thanks in advance.

ljuwaidah
01-04-2009, 08:44 AM
How about getting the data in parts?

Get the parent nodes, then when one of them is expanded get its data and so on.

Meanwhile, you can have your data in some "cache" so that later you can get the data from it instead of getting it from the database.

samsonkiran
01-05-2009, 03:27 PM
Hi

This is exactly what i am trying to do. But i do not know how to retrieve the parent node data when the parent node is expanded. So that i can pass the parent node data to DB and get the corresponding child nodes. Any help on how to retrieve the parent node data when the parent node is retrieved should be great.

ljuwaidah
01-05-2009, 06:52 PM
try this: http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html#event:itemOpen

nakedkafka
01-05-2009, 07:07 PM
sorry for being thick here, but is it not (Item/data/value). parent ?

ljuwaidah
01-06-2009, 06:48 AM
naked: i'm not quite sure what you mean.

if you mean he gets an item and gets its parent then that's not what he needs, he doesn't know which item is the child since he hasn't got it added yet, he just has a list of the parents, what he needs is to know which parent is expanded, that's what he'll know in the itemOpen event.

PS: data items have parent properties? that's pretty useful!

samsonkiran
01-07-2009, 03:41 PM
Thank you all for giving valuable suggestions. I got it working :).

thank you once again.

dindiku
02-07-2009, 02:08 PM
Hi i am also facing the same issue...can u please advice me how u have achieved this.I am returning the data as an XML from database now


Thanks in advance