Results 1 to 5 of 5

Thread: Grid with a horizontal scrollbar resizes vertically

    Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    88

    Default Grid with a horizontal scrollbar resizes vertically

    Version(s) of Ext GWT
    Ext GWT 3.0.0b

    Browser versions and OS (and desktop environment, if applicable)
    IE 9 Windows 7

    Description
    A grid with an active horizontal scrollbar resizes vertically, when you move the scrollbar or just "mousemove" at the grids content. Just look at my example below.
    In my case, I can't specify the height of my grid, since it is created dynamically and should get all the space it needs.

    Run mode
    Development Mode

    Test case

    Code:
        public void onModuleLoad()
        {
            VerticalLayoutContainer vlc = new VerticalLayoutContainer();
            vlc.setBorders(true);
            vlc.setPixelSize(300, 300);
            final MyGrid grid1 = new MyGrid();
            vlc.add(grid1);
            RootPanel.get().add(vlc);
        }
    Code:
    public class MyGrid extends Grid<TestDTO>
    {
        static TestProvider prov = GWT.create(TestProvider.class);
    
        private static ColumnConfig col1;
        private static ColumnConfig col2;
        private static ColumnConfig col3;
    
        public MyGrid()
        {
            super(new ListStore<TestDTO>(prov.oid()), new ColumnModel(getColumnConfigList()));
    
            setBorders(true);
            getView().setColumnLines(true);
    
            getStore().add(new TestDTO(1, 3, 1));
            getStore().add(new TestDTO(1, 3, 1));
        }
    
        private static List<ColumnConfig> getColumnConfigList()
        {
            List<ColumnConfig> columnConfigList = new ArrayList<ColumnConfig>();
            col1 = new ColumnConfig(prov.att1(), 250, "Column 1");
            columnConfigList.add(col1);
            col2 = new ColumnConfig(prov.att2(), 250, "Column 2");
            columnConfigList.add(col2);
            col3 = new ColumnConfig(prov.att3(), 250, "Column 3");
            columnConfigList.add(col3);
    
            return columnConfigList;
        }
    
        static class TestDTO
        {
            private int oid;
            private int att1;
            private int att2;
            private String att3;
    
            public TestDTO(int oid, int att1, int att2)
            {
                super();
                this.oid = oid;
                this.att1 = att1;
                this.att2 = att2;
            }
    
            public int getAtt1()
            {
                return att1;
            }
    
            public void setAtt1(int att1)
            {
                this.att1 = att1;
            }
    
            public int getAtt2()
            {
                return att2;
            }
    
            public void setAtt2(int att2)
            {
                this.att2 = att2;
            }
    
            public int getOid()
            {
                return oid;
            }
    
            public void setOid(int oid)
            {
                this.oid = oid;
            }
    
            public String getAtt3()
            {
                return att3;
            }
    
            public void setAtt3(String att3)
            {
                this.att3 = att3;
            }
        }
    
        interface TestProvider extends PropertyAccess<TestDTO>
        {
    
            ModelKeyProvider<TestDTO> oid();
    
            ValueProvider<TestDTO, Integer> att1();
    
            ValueProvider<TestDTO, Integer> att2();
    
            ValueProvider<TestDTO, String> att3();
        }
    
    }

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    88

    Default

    It's still an issue in GXT 3.0.1

  3. #3
    Ext GWT Premium Member
    Join Date
    May 2011
    Posts
    1

    Default

    It is still an issue in 3.0.2. Anybody can help with this? Maybe you know some walkaround for this?

  4. #4
    Sencha User
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737

    Default

    If I'm not mistaken, you aren't assigning the Grid a height, but if you do, the issue doesn't seem to be present - is that correct?

    The GXT Grid, in 3.x as in 2.x, is not designed to be used without an assigned size, either by a parent passing along a size, or explicitly setting a height.

    In the initial example, the line
    Code:
           vlc.add(grid1);
    should almost certainly be
    Code:
           vlc.add(grid1, new VerticalLayoutData(1.0,1.0));
    instructing it to take all remaining available height and width within that VLC.

    If you are having similar problems with a sized grid, please let us know, and we'll look into it.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Posts
    88

    Default

    It was in fact a layout problem, thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •