1 Reply Latest reply on Jan 29, 2009 5:21 AM by Newsgroup_User

    Grouping Collection in the List

    Sankar Kethineni
      Hi All,

      First off all, is it possible to use the GroupingCollection in the List like in ADG? If yes,try to solve the following......

      Am using the List Component to display the data for example, name of the book and author of the book by using the vbox in the itemRenderer for List.

      Is it possible to group the books written by one author ? (like the Grouping Collection example for Advanced DataGrid in Flex Component explorer 3: http://examples.adobe.com/flex3/componentexplorer/explorer.html ->Data Visualization Components->Advanced DataGrid)

      Unlike in the ADG example, i wanted to group the books when there is a book written by more than one author and if there is a one book in the list it should be displayed as a item only but it should not displayed as under folder whose name is same as the item name.

      Any Help can be appriciated.

      Here is the sample code (in this example,for java there is only one book but it is displaying as under Java folder.It should be displayed as the item only.)
        • 1. Re: Grouping Collection in the List
          Level 7

          "sankar83" <webforumsuser@macromedia.com> wrote in message
          news:glrn3m$7ht$1@forums.macromedia.com...
          > Hi All,
          >
          > Am using the List Component to display the data for example, name
          > of
          > the book and author of the book by using the vbox in the itemRenderer for
          > List.
          >
          > Is it possible to group the books written by one author ? (like the
          > Grouping
          > Collection example for Advanced DataGrid in Flex Component explorer 3:
          > http://examples.adobe.com/flex3/componentexplorer/explorer.html ->Data
          > Visualization Components->Advanced DataGrid)
          >
          > Unlike in the ADG example, i wanted to group the books when there is a
          > book written by more than one author and if there is a one book in the
          > list it
          > should be displayed as a item only but it should not displayed as under
          > folder
          > whose name is same as the item name.

          I think you'll need to use Tree. Somewhere I've seen code for a custom
          DataDescriptor that lets you do what you're talking about, but I haven't
          been able to find it in my links collection.

          The problem with using GroupingCollection for this is that it just runs
          through the list once and you get to make a decision on where each item
          goes--you can't put it in more than one place. But I think there's
          something different about how DataDescriptor works that makes it possible to
          do this.

          HTH;

          Amy