3 Replies Latest reply on Aug 7, 2008 7:06 AM by jim1234

    advanced data grid and grouping

    jim1234 Level 1
      This is probably a basic questions, so hopefully someone will know the answer. I have an advanced data grid that works find a follows:

      <mx:AdvancedDataGrid id="adgReportList"
      horizontalCenter="0"
      y="28" width="485" height="500" dataProvider="{reports}">

      <mx:columns>
      <mx:AdvancedDataGridColumn headerText="Proposal Number" dataField="PROPOSAL_NUMBER"/>
      <mx:AdvancedDataGridColumn headerText="Report Title" dataField="REPORT_TITLE"/>
      <mx:AdvancedDataGridColumn headerText="Report Start Date" dataField="PERIOD_BEGINING"/>
      </mx:columns>
      </mx:AdvancedDataGrid>

      So the data coming back seems to be fine. But when I try to group the data as follows, nothing shows:

      <mx:AdvancedDataGrid id="adgReportList"
      horizontalCenter="0"
      y="28" width="485" height="500" initialize="gc.refresh();">

      <mx:dataProvider>
      <mx:GroupingCollection id="gc" source="{reports}">
      <mx:grouping>
      <mx:Grouping>
      <mx:GroupingField name="PROPOSAL_NUMBER" />
      </mx:Grouping>
      </mx:grouping>
      </mx:GroupingCollection>
      </mx:dataProvider>

      <mx:columns>
      <mx:AdvancedDataGridColumn headerText="Proposal Number" dataField="PROPOSAL_NUMBER"/>
      <mx:AdvancedDataGridColumn headerText="Report Title" dataField="REPORT_TITLE"/>
      <mx:AdvancedDataGridColumn headerText="Report Start Date" dataField="PERIOD_BEGINING"/>
      </mx:columns>
      </mx:AdvancedDataGrid>

      Thanks for any help.
      Jim
        • 1. Re: advanced data grid and grouping
          jim1234 Level 1
          Ok, I know what the problem is, I just don't know a good way to fix it.

          The problem is that the ArrayCollection that I use to populate the data grid does not have data until after the initialize event is fired. So I need to find out where/how to call the gc.refresh() method after the ArrayCollection has data.

          Any ideas?

          Thanks,
          Jim
          • 2. Re: advanced data grid and grouping
            Level 7

            "jim1234" <webforumsuser@macromedia.com> wrote in message
            news:g7eqkr$g6m$1@forums.macromedia.com...
            > Ok, I know what the problem is, I just don't know a good way to fix it.
            >
            > The problem is that the ArrayCollection that I use to populate the data
            > grid
            > does not have data until after the initialize event is fired. So I need
            > to
            > find out where/how to call the gc.refresh() method after the
            > ArrayCollection
            > has data.

            You're binding to it. Make sure it is bindable.


            • 3. advanced data grid and grouping
              jim1234 Level 1
              Yes, it is bindable, but I still have the problem.

              Thanks,
              Jim