You found a bug! We've classified it as EXTGWT-2798 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member feelinforyou's Avatar
    Join Date
    Dec 2012
    Posts
    94
    Vote Rating
    4
    feelinforyou is on a distinguished road

      0  

    Default GridHeaderGrouping alignment bugs

    GridHeaderGrouping alignment bugs


    Required Information

    Version(s) of Ext GWT
    EXT GWT 3.0.1

    Browser versions and OS
    (and desktop environment, if applicable)
    • every browser

    Virtual Machine
    No

    Description
    There are two bugs in the HeaderGroupConfig.
    • If you hover a grouped header with rowspan 2 then, the text will be aligned to the top from the middle. You can comprehend this with my example or if you hover the date in this example
      http://www.sencha.com/examples/#Exam...ggregationgrid
    • If you add a Rownumberer to a grouped header grid everything ist going crazy


    Run mode
    both

    Steps to reproduce the problem
    1. Start running in development mode in Eclipse
    2. Open app in browser
    3. first everthing is fine
    4. stop running in development mode in Eclipse
    5. remove comment for //columns.add(numberer);
    6. set values from
      cm.addHeaderGroup(0, 1, new HeaderGroupConfig("Spiele", 1, 3));
      cm.addHeaderGroup(0, 4, new HeaderGroupConfig("Tore", 1, 2));
      to
      cm.addHeaderGroup(0, 2, new HeaderGroupConfig("Spiele", 1, 3));
      cm.addHeaderGroup(0, 5, new HeaderGroupConfig("Tore", 1, 2));
    7. Start running in development mode in Eclipse
    8. Open app in browser
    9. Everything is out of order

    Expected result
    right alignment with rownumberer

    Actual result
    some columns seems to sync the size with the rownumberer colum

    Test case
    Code:
    package test.client;
    
    import java.util.ArrayList;
    import java.util.Date;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.user.client.ui.RootPanel;
    import com.sencha.gxt.core.client.IdentityValueProvider;
    import com.sencha.gxt.core.client.ValueProvider;
    import com.sencha.gxt.data.shared.ListStore;
    import com.sencha.gxt.data.shared.ModelKeyProvider;
    import com.sencha.gxt.data.shared.PropertyAccess;
    import com.sencha.gxt.widget.core.client.ContentPanel;
    import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
    import com.sencha.gxt.widget.core.client.grid.ColumnModel;
    import com.sencha.gxt.widget.core.client.grid.Grid;
    import com.sencha.gxt.widget.core.client.grid.HeaderGroupConfig;
    import com.sencha.gxt.widget.core.client.grid.RowNumberer;
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class Test implements EntryPoint {
    
        private ListStore<IPlayer> store;
    
        public void onModuleLoad() {
            ContentPanel panel = new ContentPanel();
            panel.setSize("1000", "300");
            panel.add(createGrid());
    
            RootPanel.get().add(panel);
        }
    
        public Grid<IPlayer> createGrid() {
            final TableProperty tableProperty = GWT.create(TableProperty.class);
    
            final IdentityValueProvider<IPlayer> identity = new IdentityValueProvider<IPlayer>();
            final RowNumberer<IPlayer> numberer = new RowNumberer<IPlayer>(identity);
    
            final ColumnConfig<IPlayer, String> ccPlayerName =
                    new ColumnConfig<IPlayer, String>(tableProperty.label(), 40, "Spieler");
            final ColumnConfig<IPlayer, Integer> ccSingleMatches =
                    new ColumnConfig<IPlayer, Integer>(tableProperty.singleMatches(), 100, "Anzahl Spiele");
            final ColumnConfig<IPlayer, Integer> ccSingleWins =
                    new ColumnConfig<IPlayer, Integer>(tableProperty.singleWins(), 100, "Siege");
            final ColumnConfig<IPlayer, Integer> ccSingleLosses =
                    new ColumnConfig<IPlayer, Integer>(tableProperty.singleLosses(), 100, "Niederlagen");
            final ColumnConfig<IPlayer, String> ccSingleGoals =
                    new ColumnConfig<IPlayer, String>(tableProperty.singleGoals(), 100, "Tore");
            final ColumnConfig<IPlayer, String> ccSingleGoalDifference =
                    new ColumnConfig<IPlayer, String>(tableProperty.singleGoalDifference(), 100, "Tordifferenz");
            final ColumnConfig<IPlayer, Integer> ccPoints =
                    new ColumnConfig<IPlayer, Integer>(tableProperty.points(), 100, "Punkte");
    
            final ArrayList<ColumnConfig<IPlayer, ?>> columns = new ArrayList<ColumnConfig<IPlayer, ?>>();
            //columns.add(numberer);
            columns.add(ccPlayerName);
            columns.add(ccSingleMatches);
            columns.add(ccSingleWins);
            columns.add(ccSingleLosses);
            columns.add(ccSingleGoals);
            columns.add(ccSingleGoalDifference);
            columns.add(ccPoints);
    
            ColumnModel<IPlayer> cm = new ColumnModel<IPlayer>(columns);
    
            cm.addHeaderGroup(0, 1, new HeaderGroupConfig("Spiele", 1, 3));
            cm.addHeaderGroup(0, 4, new HeaderGroupConfig("Tore", 1, 2));
    
            store = new ListStore<IPlayer>(tableProperty.id());
    
            final Grid<IPlayer> grid = new Grid<IPlayer>(store, cm);
            grid.getView().setAutoExpandColumn(ccPlayerName);
            grid.getView().setAutoExpandMax(100);
            grid.getView().setStripeRows(true);
            grid.getView().setColumnLines(true);
    
            return grid;
        }
    
        public interface TableProperty extends PropertyAccess<IPlayer> {
            public ModelKeyProvider<IPlayer> id();
    
            public ValueProvider<IPlayer, String> label();
    
            public ValueProvider<IPlayer, Integer> singleWins();
    
            public ValueProvider<IPlayer, Integer> singleLosses();
    
            public ValueProvider<IPlayer, Integer> singleMatches();
    
            public ValueProvider<IPlayer, String> singleGoals();
    
            public ValueProvider<IPlayer, String> singleGoalDifference();
    
            public ValueProvider<IPlayer, Integer> doubleWins();
    
            public ValueProvider<IPlayer, Integer> doubleLosses();
    
            public ValueProvider<IPlayer, String> doubleGoals();
    
            public ValueProvider<IPlayer, Integer> points();
    
        }
    
        public interface IPlayer {
    
            public void setId(long id);
    
            public long getId();
    
            public void setLabel(String label);
    
            public String getLabel();
    
            public void setLastMatchDate(Date lastMatchDate);
    
            public Date getLastMatchDate();
    
            public Integer getSingleMatches();
    
            public void setSingleMatches(Integer singleMatches);
    
            public Integer getSingleWins();
    
            public void setSingleWins(Integer singleWins);
    
            public Integer getSingleLosses();
    
            public void setSingleLosses(Integer singleLosses);
    
            public String getSingleGoals();
    
            public void setSingleGoals(String singleGetGoals);
    
            public String getSingleGoalDifference();
    
            public void setSingleGoalDifference(String singleGoalDifferenz);
    
            public Integer getDoubleWins();
    
            public void setDoubleWins(Integer doubleWins);
    
            public Integer getDoubleLosses();
    
            public void setDoubleLosses(Integer doubleLosses);
    
            public String getDoubleGoals();
    
            public void setDoubleGoals(String doubleGoals);
    
            public Integer getPoints();
    
            public void setPoints(Integer points);
        }
    
    }
    Helpful Information

    Possible fix
    ┬źNot provided┬╗

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    Thanks, but for future reference, file two different issues - I've created EXTGWT-2797 and EXTGWT-2798 based on this, and can't link either one without confusing the other for people who follow this thread.