0 Replies Latest reply on May 4, 2011 12:22 PM by Shravan P

    How can i sort a groupingfield in AdvancedDataGrid

    Shravan P Level 1

      Hello,

       

      I have a AdvanceddataGrid, in that i have a groupingfield called "month" which contains months data(ex: April 2011).

      When i populate the data in ADG, the months are not populating in a chronological order. how can i achieve this.

       

      In this below image, i need to get months in chronological order. i used custom sort for children(1,2,3,4,5,6) and its working fine.. but how can i make this custom sort for chronological order.

       

      adg_grpfield_sort.JPG

      i used this below code, but its only working for alphabetical order. i need to get it done in chronological order.

       

      private function sortData():void {
         
      var sort:Sort = new Sort();
         
      var sortField:SortField = new SortField("Count");

          sort
      .fields = [sortField];        // Set 'Product' as the field to be sorted on
          myADG
      .dataProvider.sort = sort;   // Add the sort to the dataProvider of the dataGrid
          gc
      .source.refresh();              // Refresh the GroupCollection
      }

       

      can anyone help me out in this issue.