displayItemsExpanded calls ADG. expandAll() method, for which the source code 
is available

I have checked that all the variables involved in that method are either 
protect or mx_internal, 
So you could probably subclass ADG and write a variant (eg. expandUpToLevel()) 
to do what you expect.

(hint: extend the test     if (isBranch(item) && !isItemOpen(item)))

Maurice 

-------------------

Source code:
   public function expandAll():void
    {
        if (dataProvider is IHierarchicalCollectionView && iterator)
        {
            // move to the first item
            iterator.seek(CursorBookmark.FIRST);
            while(!iterator.afterLast)
            {
                var item:Object = iterator.current;
                // open the item if its a branch item and its not already open
                if (isBranch(item) && !isItemOpen(item))
                {
                    IHierarchicalCollectionView(collection).openNode(item); // 
open node
                    
                    // dispatch ITEM_OPEN event
                    var itemRenderer:IListItemRenderer = 
visibleData[itemToUID(item)];
                    
dispatchAdvancedDataGridEvent(AdvancedDataGridEvent.ITEM_OPEN,
                                                  item,
                                                  itemRenderer,
                                                  null);
                }
                iterator.moveNext();
            }
            itemsSizeChanged = true;
            invalidateDisplayList();
            // seek to the correct position
            iterator.seek(CursorBookmark.FIRST, verticalScrollPosition);
        }
    }

-----Message d'origine-----
De : Oleg Konovalov [mailto:[email protected]] 
Envoyé : lundi 5 mai 2014 13:11
À : [email protected]
Objet : Fwd: Expanding ADG to particular level

i,



I have AdvancedDataGrid with multi level GroupingCollection2 which shows 1000s 
of rows.

I am using displayItemsExpanded="true".



Is there a way not to expand it not all the way up, but to the particular level 
of grouping,

lets say to level 1 programmatically ?

So in that case user will see 100s of 1st level groups (each having 5-10 rows 
inside).

That makes a lot of sense and convenient to users.



How can I do that?



Using Flex 4.5.1 with Flex3 ADG.





TIA,

Oleg.



--
Thank you,
Oleg.

Reply via email to