Announcement

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

    5.1d ListGrid does not group data under certain circumstances

    Hi Isomorphic,

    I just noticed that 5.1d (SNAPSHOT_v10.1d_2015-10-07) does not group ListGrid data on load under certain circumstances (working in 5.0p).
    I'll come up with a testcase soon, but perhaps you have already an idea if I describe the symtoms:

    - 179 rows (fetch/grouping limit was for 1000), should be grouped on load (ListGrid is always grouped, grouping can't be configured)
    - "Grouping data" popup displayed, but not grouped afterwards
    - No error in developer console
    - Grouping field hidden in ListGrid

    As I have another Grid where this works and where the grouping field is shown, I suspect it to be related to this.
    The other difference to the working case is that in the working case the data is so little, that the "Grouping data" popup is not displayed.

    If this does already help you please let me know, otherwise I'll try to create a testcase.

    Best regards
    Blama

    #2
    Grouping is working in general with hidden fields in our testing. Essentially we haven't come across what you're describing, so probably best to show us a test case if possible.

    Thanks
    Isomorphic Software

    Comment


      #3
      Hi Isomorphic,

      this was more easy than I thought. Please see this BuiltInDS-based sample using current SNAPSHOT_v10.1d_2015-10-13/PowerEdition Deployment.
      BuiltInDS.java:
      Code:
      package com.smartgwt.sample.client;
      
      import com.google.gwt.core.client.EntryPoint;
      import com.smartgwt.client.core.KeyIdentifier;
      import com.smartgwt.client.data.Criterion;
      import com.smartgwt.client.data.DataSource;
      import com.smartgwt.client.data.SortSpecifier;
      import com.smartgwt.client.types.GroupStartOpen;
      import com.smartgwt.client.types.OperatorId;
      import com.smartgwt.client.types.SortDirection;
      import com.smartgwt.client.util.Page;
      import com.smartgwt.client.util.PageKeyHandler;
      import com.smartgwt.client.util.SC;
      import com.smartgwt.client.widgets.IButton;
      import com.smartgwt.client.widgets.Window;
      import com.smartgwt.client.widgets.events.ClickEvent;
      import com.smartgwt.client.widgets.events.ClickHandler;
      import com.smartgwt.client.widgets.grid.ListGrid;
      import com.smartgwt.client.widgets.grid.ListGridField;
      
      public class BuiltInDS implements EntryPoint {
          private IButton recreateBtn;
          private DataSource supplyItemDS = DataSource.get("supplyItem");
      
          public void onModuleLoad() {
              KeyIdentifier debugKey = new KeyIdentifier();
              debugKey.setCtrlKey(true);
              debugKey.setKeyName("D");
      
              Page.registerKey(debugKey, new PageKeyHandler() {
                  public void execute(String keyName) {
                      SC.showConsole();
                  }
              });
      
              recreateBtn = new IButton("Recreate");
              recreateBtn.addClickHandler(new ClickHandler() {
                  @Override
                  public void onClick(ClickEvent event) {
                      recreate();
                  }
              });
              recreate();
              recreateBtn.draw();
          }
      
          private void recreate() {
              Window w = new Window();
              w.setWidth("95%");
              w.setHeight("95%");
              w.setMembersMargin(0);
              w.setModalMaskOpacity(70);
              w.setTitle("Grouping test");
              w.setShowMinimizeButton(false);
              w.setIsModal(true);
              w.setShowModalMask(true);
              w.centerInPage();
      
              ListGrid lg = new ListGrid(supplyItemDS);
              lg.setCanEdit(false);
              lg.setCanGroupBy(false);
              lg.setGroupByMaxRecords(2000);
              lg.setAllowFilterExpressions(true);
              lg.setShowFilterEditor(true);
              lg.setAutoFetchData(false);
              lg.setGroupStartOpen(GroupStartOpen.ALL);
              lg.setCanGroupBy(false);
              lg.setCanReorderFields(true);
      
              ListGridField itemIdLGF = new ListGridField("itemID");
              ListGridField itemNameLGF = new ListGridField("itemName");
              ListGridField skuLGF = new ListGridField("SKU");
              ListGridField descriptionLGF = new ListGridField("description");
              ListGridField categoryLGF = new ListGridField("category");
              // categoryLGF.setHidden(true);
              // categoryLGF.setCanHide(false);
              ListGridField unitsLGF = new ListGridField("units");
      
              lg.setSortByGroupFirst(true);
              lg.setGroupByField(categoryLGF.getName());
      
              lg.setFields(itemIdLGF, itemNameLGF, skuLGF, descriptionLGF, categoryLGF, unitsLGF);
      
              lg.setSort(new SortSpecifier[] { new SortSpecifier(itemIdLGF.getName(), SortDirection.ASCENDING),
                      new SortSpecifier(itemNameLGF.getName(), SortDirection.ASCENDING) });
      
              lg.fetchData(new Criterion(itemIdLGF.getName(), OperatorId.LESS_OR_EQUAL, 200));
      
              w.addItem(lg);
              w.show();
          }
      }
      I just tested FF26 DevMode now, but as it also happens for me compiled in my app, I'm pretty sure it is a more general problem.

      Best regards
      Blama

      Comment


        #4
        We are looking into this. It's a slightly tricky area to resolve so we don't yet have a fix but we do have a workaround you can apply for now.
        If you simply reverse the order of the "setSort(...)" and "fetchData(...)" calls, the issue goes away:

        Code:
                lg.fetchData(new Criterion(itemIdLGF.getName(), OperatorId.LESS_OR_EQUAL, 200));
                lg.setSort(new SortSpecifier[] { new SortSpecifier(itemIdLGF.getName(), SortDirection.ASCENDING),
                        new SortSpecifier(itemNameLGF.getName(), SortDirection.ASCENDING) });
        We'll follow up when we have a proper resolution for you.

        Thanks
        Isomorphic Software

        Comment


          #5
          Ok - we've made a change which should address this. Please try the next nightly build - Oct 20 or above

          Regards
          Isomorphic Software

          Comment


            #6
            Hi Isomorphic,

            the fix from Oct 19th seems to work with no code changes in my application. I'll retest with the testcase as well tomorrow, but it will work, I'd guess.

            Thanks a lot,
            Blama

            Comment

            Working...
            X