Announcement

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

    setAutoFitFieldWidths(true)-ListGrid shows horizontal scrollbar on sort

    Hi Isomorphic,

    please see this 5.1p BuiltInDS based testcase (using v10.1p_2016-01-20/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.AdvancedCriteria;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.types.AutoFitWidthApproach;
    import com.smartgwt.client.types.OperatorId;
    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.layout.VLayout;
    
    public class BuiltInDS implements EntryPoint {
        private VLayout mainLayout;
        private IButton recreateBtn;
    
        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();
                }
            });
    
            mainLayout = new VLayout(20);
            mainLayout.setWidth100();
            mainLayout.setHeight100();
    
            recreateBtn = new IButton("Recreate");
            recreateBtn.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    recreate();
                }
            });
            mainLayout.addMember(recreateBtn);
            recreate();
            mainLayout.draw();
        }
    
        private void recreate() {
            Window w = new Window();
            w.setWidth("95%");
            w.setHeight("95%");
            w.setMembersMargin(0);
            w.setModalMaskOpacity(70);
            w.setTitle("Sorting by a field which header-width larger than data-width causes horizontal scroll bar");
            w.setShowMinimizeButton(false);
            w.setIsModal(true);
            w.setShowModalMask(true);
            w.centerInPage();
    
            ListGrid lg = new ListGrid(DataSource.get("supplyItem"));
            lg.setWidth100();
            lg.setHeight(600);
            lg.setCanSort(true);
            lg.setAutoFitFieldWidths(true);
            lg.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
    
            w.addItem(lg);
            w.show();
    
            lg.fetchData(new AdvancedCriteria("itemName", OperatorId.ISTARTS_WITH, "Acc"));
        }
    }[B][/B]


    If you click e.g. "Unit Cost", after sorting the ListGrid will have a horizontal scrollbar. This is also true for other columns where the header-width is larger than the data-width (e.g. "Next Shipment").
    I think the columnwidth-sizing should be in a way, that the column can accommodate the sort arrow and possible sort indicators.
    This has a low priority for me.

    Best regards
    Blama

    #2
    We've made a change to address this issue.
    Please try the next nightly build (5.1p branch or 6.0d branch) to pick up the change

    Regards
    Isomorphic Software

    Comment


      #3
      Hi Isomorphic,

      this is fixed for me.

      Thanks
      Blama

      Comment

      Working...
      X