0 Replies Latest reply on Jan 23, 2011 12:59 PM by Frank F._

    AdvancedDatagrid grouping data in runtime

    Frank F._

      Hi all,

       

      i promise, this is the last post today concerning the adg.

       

      I have to chage the grouping condition in runtime. My adg looks like...

       

      ...

          <mx:dataProvider>
              <mx:GroupingCollection2 id="gc" source="{model.dp}">
                  <mx:Grouping>
                      <mx:GroupingField id="gf" name="contractNumber" descending="true">
                          <mx:summaries>
                              <mx:SummaryRow summaryPlacement="group">
                                  <mx:fields>
                                      <mx:SummaryField2 dataField="salesRevenue" summaryOperation="SUM" />

      ...

       

      Now i need the possibility to switch the grouping condition. My first try is:

       

                  protected function advanceddatagrid1_clickHandler(event:MouseEvent):void
                  {
                      trace ("click");
                      gf.name="billAddress";
                      gc.refresh();
                      this.callLater(validateNow);
                  }

       

      And it works nearly fine. The shown code is an handler for a click. Unfortunately the second click will switch the condition. After the first click nothin happens. Why?

       

      Thank you very much

       

      BR

      Frank