0

I am using an AdvancedDataGrid with two GroupingFields. The dataProvider has a list of objects with these two field values, but occasionally the second field value can be null. When it loads, the AdvancedDataGrid UI has a root folder (first GroupingField) and some additional subfolders (second GroupingField). This is all good. However, the objects with a null value for the second GroupingField, just get placed in a subfolder with no label.

I want the objects with a null second GroupingField value to appear as leaf nodes beneath the root folder (first GroupingField) minus the blank subfolder.

A good way to picture this would be a file explorer. Is there a good way to do this? Make the folder icon disappear maybe after expanding this node through actionscript?

ParentFolder
   SubFolder
      Leaf Object
      Leaf Object
   SubFolder
      Leaf Object
   Leaf Object
   Leaf Object
shadenite
  • 474
  • 6
  • 9
  • ADG is a terrible and wondrous thing. I'm still trying to figure out the "data" object structure when using group fields Cheers – Richard Haven Feb 20 '09 at 21:54

2 Answers2

0

You can remove the blank objects from your list of objects first(using a loop or filterfunction) and then set it as the dataprovider of the datagrid.

0

You may want to consider passing hierarchical data into your ADG rather than using a GroupingCollection on flat data. With hierarchical data, nodes with children will be represented as folders, nodes without children will show as leafs (just like a Tree control behaves).

Just like this: http://www.flex-blog.com/tree-in-advanced-datagrid-example/

Jeremy Mitchell
  • 329
  • 5
  • 18