I am thinking of another solution:
Make displayItemsExpanded and
somehow expand it, which would make it expanded to 1st level folders,
since my ADG is 2 groups deep.
Is there a way to expand the ADG group programmatically?
On May 5, 2014 8:15 AM, "Maurice Amsellem" <[email protected]>
wrote:
> 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.
>