Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext GWT Premium Member
    Join Date
    Mar 2009
    Posts
    226
    Vote Rating
    3
    The_Jackal is on a distinguished road

      0  

    Default GXT 2.2.4 Grid Header Groups cause header and body columns to be out of sync

    GXT 2.2.4 Grid Header Groups cause header and body columns to be out of sync


    If a header group text is wider than the total width of the columns it spans then the header group's width will used in the header section, but the widths of the spanned columns in the body of the grid will not be expanded proportionally in the body of the grid causing the body and header not to line up.

    This can easier occur by setting the widths of columns and that have a header group. The body columns will not line up with the header columns.

    GroupHeaderBug.JPG

    Here is the code that can reproduce this:

    Code:
    public class AnalystWorkspace implements EntryPoint
    {
        public void onModuleLoad() {
            new MyWindow().show();
        }
        
        private class MyWindow extends Window {
    
            public MyWindow() {
                super();
                setLayout(new FitLayout());
                setWidth(400);
                setHeight(150);
                setHeading("My window");
                add(getMainPanel());
            }
    
            private ContentPanel getMainPanel() {
                ContentPanel panel = new ContentPanel();
                panel.setLayout(new RowLayout(Orientation.VERTICAL));
                panel.add(getGrid(), new RowData(1, 1));
                panel.setHeaderVisible(false);
                panel.setBodyBorder(false);
    
                return panel;
            }
    
    
            private Grid<BaseModel> getGrid() {
    
                ColumnModel cm = new ColumnModel(Arrays.asList(
                        new ColumnConfig("1", "1", 30),
                        new ColumnConfig("2", "2", 30),
                        new ColumnConfig("3", "3", 30), 
                        new ColumnConfig("4", "4", 30)));
    
                HeaderGroupConfig hgc1 = new HeaderGroupConfig("Group Header breaks columns in body", 1, 2);
                cm.addHeaderGroup(0, 0, hgc1);
    
                HeaderGroupConfig hgc2 = new HeaderGroupConfig("B", 1, 2);
                cm.addHeaderGroup(0, 2, hgc2);
    
                ListStore<BaseModel> store = new ListStore<BaseModel>();
                for (int i = 1; i <= 3; i++) {
                    BaseModel m = new BaseModel();
                    m.set("1", i);
                    m.set("2", i);
                    m.set("3", i);
                    m.set("4", i);
                    store.add(m);
                }
    
                Grid<BaseModel> grid = new Grid<BaseModel>(store, cm);
                grid.setHeight("100%");
    
                return grid;
            }
        }
    
    }
    Update:

    My suggestions are to not force a width on the header, or if you do make sure to proportionally set the widths of all the columns that are grouped under that header.

    I have done the second option as a workaround each time the grid is refreshed and I also had to catch manual resizes via the Grid firing ColumnResize Events and again proportionally resize the columns to match the header. This is a less than optimal workaround.

    Regards,
    Carl.
    Last edited by The_Jackal; 4 Jan 2012 at 4:45 AM. Reason: Update with more detail

  2. #2
    Sencha User becevka's Avatar
    Join Date
    Oct 2008
    Posts
    53
    Vote Rating
    0
    becevka is on a distinguished road

      0  

    Default


    Is there any feedback on this issue?
    Thanks

  3. #3
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Quote Originally Posted by becevka View Post
    Is there any feedback on this issue?
    Thanks
    Currently not. All updates to the issues are always published in the threads.

  4. #4
    Ext GWT Premium Member
    Join Date
    Mar 2009
    Posts
    226
    Vote Rating
    3
    The_Jackal is on a distinguished road

      0  

    Default


    Is there any feedback on this issue?
    I'm still stuck with proportionally setting the sub heading widths

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Posts
    8
    Vote Rating
    0
    planadecu is on a distinguished road

      0  

    Default


    This happens cause the underline implementation has 2 html tables. Try to put a fixed width on the parent.

    Hope it helps, first answer

  6. #6
    Ext GWT Premium Member
    Join Date
    Mar 2009
    Posts
    226
    Vote Rating
    3
    The_Jackal is on a distinguished road

      0  

    Default


    This happens cause the underline implementation has 2 html tables. Try to put a fixed width on the parent.
    In my situation I can't put a fixed width as the text is dynamic. The framework should be setting the widths as needed.

Thread Participants: 3