Threaded View

    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

Thread Participants: 3

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi