0 Replies Latest reply on Aug 12, 2009 8:24 AM by john isaacks

    AdvanvedDataGrid Grouping....WHAT AM I DOING WRONG???

    john isaacks Level 1

      I am trying to do some grouping with the AdvancedDataGrid... I cannnot get it to work at all. When I removed the grouping the data loads into the data grid fine, but when i put the grouping in, there is no data displayed in the grid. This is so very frustrating...I am doung exactly what all the examples I have read say to do and it just wont work for me. Only difference is my data is an XMLList and none of the examples I have seen use XML.

       

       

      Here is my code:

       

       

       

      <mx:XMLList xmlns="" id="temp">

      <stat associate="John Doe" date="08/12/09" amount="2" time="9 am" customer="Sam Smith"/>

      <stat associate="John Doe" date="08/12/09" amount="2" time="10 am" customer="Berry Cooper"/>

      <stat associate="Bill Ace" date="08/12/09" amount="1" time="9 am" customer="Sandy James"/>

      </mx:XMLList>

       

      <mx:AdvancedDataGrid

      id="grid"

      width="100%"

      height="100%"

      styleName="dataGrid"

       

      >

      <!--dataProvider="{_statsXMLList}"-->

      <mx:dataProvider>

                  <mx:GroupingCollection id="gc" source="{temp}">

                      <mx:grouping>

                      <mx:Grouping>

                          <mx:GroupingField name="@associate" />

                      </mx:Grouping>

                      </mx:grouping>

                  </mx:GroupingCollection>

              </mx:dataProvider>

       

      <mx:columns>

                  <mx:AdvancedDataGridColumn id="dataGridCol1"

                          dataField="@associate"

                          headerText="Associate"

                          width="110"/>

                  <mx:AdvancedDataGridColumn id="dataGridCol2"

                          dataField="@amount"

                          headerText="Amount"

                          width="50" />

                  <mx:AdvancedDataGridColumn id="dataGridCol3"

                          dataField="@time"

                          headerText="Time"

                          width="80" />

                  <mx:AdvancedDataGridColumn id="dataGridCol4"

                          dataField="@customer"

                          headerText="Customer"

                          width="110" />

              </mx:columns>

      </mx:AdvancedDataGrid>

       

       

      Please help.