Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Unable to sort (using grid's API's) in grouped ListGrid

    Using smartgwt-2.4 and facing a client-side problem while sorting an already grouped grid.

    Have a ListGrid (with an underlying datasource) without the header and displaying some formatted HTML data in rows.

    Able to sort the grid when it is not grouped by any field, but when its grouped by some field its not getting sorted using the grid's sort() method after applying the SortSpecifiers i.e. Field and Direction.

    Sample code:
    -------------
    Step 1) ListGrid is already grouped by Field-1
    grid.groupBy("Field-1");

    Step 2) Now trying to sort the grid on different field.
    grid.setSort(new SortSpecifier[] { new SortSpecifier("Field-2",
    SortDirection.DESCENDING) });
    grid.sort();

    If we skip Step-1 then sorting is working correctly in Step-2 otherwise when grid is already grouped the sorting won't be applicable with-in the grid's group tree.

    Please suggest if anybody has encountered such scenario.

    #2
    We believe this is coming from a team that has support, however, you're using some kind of generic account that isn't marked as having support. Use your individual developer accounts instead or forums posts will not be corrected treated as support requests.

    As far as this issue, setSort followed by sort() is redundant. Other than that, sorting while grouped works fine in the Showcase, so you will need to isolate the problem further before we can help.

    Comment


      #3
      Sort with grouping problem within ShowCase demos

      Hello.

      I also encountered with problem when sorting does not work with grouping in my own project.
      I checked the ShowCase demos and found that it is not my mistake.
      Example:
      http://www.smartclient.com/smartgwt/showcase/#grid_grouping_modes
      Try to sort by Continent column - the sort does not work ...

      Comment


        #4
        Sorting with grouping more than 1 column

        Hello
        I used SmartGWT 3.1p version, Mozilla Firefox 18.

        I used ListGrid with several sort columns:
        Code:
        	public SortSpecifier[] getPaymentBaseSortSpecifiers() {
        		SortSpecifier[] result = null;
        		List<SortSpecifier> sortSpecifiers = new ArrayList<SortSpecifier>();
        		SortSpecifier company = new SortSpecifier("company", SortDirection.ASCENDING);
        		SortSpecifier paymentWay = new SortSpecifier("paymentWay", SortDirection.ASCENDING);
        		SortSpecifier client = new SortSpecifier("client", SortDirection.ASCENDING);
        		SortSpecifier paymentType = new SortSpecifier("paymentType", SortDirection.ASCENDING);
        		SortSpecifier reason = new SortSpecifier("reason", SortDirection.ASCENDING);		
        		sortSpecifiers.add(company);
        		sortSpecifiers.add(paymentWay);
        		sortSpecifiers.add(client);
        		sortSpecifiers.add(paymentType);
        		sortSpecifiers.add(reason);
        		result = sortSpecifiers.toArray(new SortSpecifier[0]);
        		return result;
        	}
        then i use groupBy method for ListGrid object with grouping on 1 field
        Code:
        		listGrid.setSort(getPaymentBaseSortSpecifiers());
        		listGrid.groupBy("company");
        and records in my ListGrid sorted well, but if i add another field in groupBy method like here:
        Code:
        		listGrid.setSort(getPaymentBaseSortSpecifiers());
        		listGrid.groupBy("company", "paymentWay");
        the sorting does not work as expected.
        I attached 2 files which shows sorting problem ...
        Attached Files

        Comment


          #5
          We see the issue and someone's assigned to take a look - we'll update this thread when we have a solution

          Comment


            #6
            This issue has been addressed in 3.1p and 4.0d - please retest with a nightly build of January 12 or later

            Comment


              #7
              Ok, thanks a lot!

              Comment


                #8
                Hello, i retested this issue with build dated 2013-01-16, it is still persists ... Is it the big problem which requires a lot of time to be corrected or Isomorphic team does not yet started to work with it?

                Comment


                  #9
                  We've made a fix to address this issue for SC8.3p/SGWT 3.1p and SC 9.0d/SGWT 4.0d which should be in the next nightly builds.

                  Comment


                    #10
                    I retested this issue with build dated 2013-01-19. Sorting with multiple grouping is working now! Thanks Isomorphic!

                    Comment


                      #11
                      Hello again.
                      Found another problem with sorting of columns in ListGrid which has multiple grouping fields. If for this grid i use:

                      listGrid.setShowGroupSummaryInHeader(true);

                      then sorting is broken ...

                      Comment


                        #12
                        We see a similar issue in testing - there was a JS crash reported in the developer console, rather than sorting just not working, but having fixed that issue we see sorting work as expected, with single or multiple grouping levels. The fixes are in, please retest with a nightly of 4.0d dated January 23 or later.
                        Last edited by Isomorphic; 22 Jan 2013, 02:07.

                        Comment


                          #13
                          In fact, we see another issue here - someone's taking a look and will update this thread with progress.

                          Comment


                            #14
                            We've made a number of fixes in this area to 3.1p and 4.0d - sorting should now work in all circumstances, with or without single or multi-grouping, on groupFields or otherwise, and whether summaries are being shown in headers or as separate rows, or not at all.

                            Please retest with a nightly build of January 25 or later.

                            Comment


                              #15
                              Thanks sorting is ok now!

                              Comment

                              Working...
                              X