You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Oleg Konovalov <ol...@gmail.com> on 2014/05/04 05:36:18 UTC

Expanding ADG to particular level

Hi,



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.

RE: Expanding ADG to particular level

Posted by Oleg Konovalov <ol...@gmail.com>.
As I mentioned, I am using GroupingCollection2 as ADG dataProvider.
And it doesn't seem to have anything like openNode or expandItem.
So how can expand its root node?

Please advise.

TIA,
Oleg
On May 5, 2014 11:08 AM, "Oleg Konovalov" <ol...@gmail.com> wrote:

> 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" <ma...@systar.com>
> 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:olegkon@gmail.com]
>> Envoyé : lundi 5 mai 2014 13:11
>> À : users@flex.apache.org
>> 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.
>>
>

RE: Expanding ADG to particular level

Posted by Oleg Konovalov <ol...@gmail.com>.
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" <ma...@systar.com>
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:olegkon@gmail.com]
> Envoyé : lundi 5 mai 2014 13:11
> À : users@flex.apache.org
> 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.
>

RE: Expanding ADG to particular level

Posted by Maurice Amsellem <ma...@systar.com>.
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:olegkon@gmail.com] 
Envoyé : lundi 5 mai 2014 13:11
À : users@flex.apache.org
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.

Fwd: Expanding ADG to particular level

Posted by Oleg Konovalov <ol...@gmail.com>.
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.