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

      0  

    Default [CLOSED] 2.0M3 Grid Header Bug

    [CLOSED] 2.0M3 Grid Header Bug


    Hi,

    Platform Info:
    GXT Version: Latest from SVN (as of 2009-06-16) (PS: Tested with 2.0M3 release as well, same issue there)
    Hosted mode & Web Mode (IE/FireFox/Chrome/Safari)
    Windows XP sp3

    Problem:

    We have an issue with the grids. Seemingly, grids are aligning the column headers in a weird way. (see the screenshot for a better understanding)

    error1.PNG

    The distrubtion gets one pixel more with each additional column. The first grid has 4 columns, and the 2nd one has 144 columns. (it gets weirder if you keep increasing the column count)

    Also, when you move mouse over the header, it changes the alignment of the titles. (i marked those columns in the attachment)

    here is the sample code which produces the effect.

    Code:
        public void onModuleLoad( )
        {
            try
            {
                Viewport viewPort = new Viewport( ) ;
                viewPort.setLayout( new FitLayout( ) ) ;
                viewPort.add( getTestWidget( ) ) ;
                RootPanel.get( ).add( viewPort ) ;
            }
            catch( Throwable t )
            {
                t.printStackTrace( ) ;
            }
        }
    
        public LayoutContainer getTestWidget( )
        {
            LayoutContainer container = new LayoutContainer( ) ;
            Grid<ModelData> grid ;
            container.setLayout( new FlowLayout( ) ) ;
    
            List<ColumnConfig> configs = new ArrayList<ColumnConfig>( ) ;
    
            for( int i = 0; i < 4; i++ )
            {
                ColumnConfig fx = new ColumnConfig( "f" + i, "f" + i, 100 ) ;
                configs.add( fx ) ;
            }
    
            ColumnModel cm = new ColumnModel( configs ) ;
    
            ListStore<ModelData> store = new ListStore<ModelData>( ) ;
    
            grid = new Grid<ModelData>( store, cm ) ;
            grid.setStyleAttribute( "borderTop", "none" ) ;
            grid.setAutoExpandColumn( "f1" ) ;
            grid.setBorders( true ) ;
            grid.setStripeRows( true ) ;
    
            container.add( grid ) ;
    
            //Add second one
    
            configs = new ArrayList<ColumnConfig>( ) ;
    
            for( int i = 0; i < 144; i++ )
            {
                ColumnConfig fx = new ColumnConfig( "f" + i, "f" + i, 30 ) ;
                configs.add( fx ) ;
            }
    
            cm = new ColumnModel( configs ) ;
    
            store = new ListStore<ModelData>( ) ;
    
            grid = new Grid<ModelData>( store, cm ) ;
            grid.setStyleAttribute( "borderTop", "none" ) ;
            grid.setAutoExpandColumn( "f1" ) ;
            grid.setBorders( true ) ;
            grid.setStripeRows( true ) ;
    
            container.add( grid ) ;
    
            return container ;
        }
    During debug, we also found some clues about source of the problem. The below method in ColumnHeader.java calculates height 1 more at each iteration:

    Code:
    // line 546 as of SVN version 2009-06-16
    
      protected void adjustHeights() {
        for (Head head : heads) {
          if (head.isRendered()) {
             // THIS ONE CALCULATES HEIGHT 1 MORE AT EACH ITERATION
            int h = head.el().getParent().getHeight();
            head.el().setHeight(h, true);
          }
        }
      }
    Thanks for the help.

  2. #2
    Ext User
    Join Date
    Jun 2009
    Posts
    6
    Vote Rating
    0
    dron is on a distinguished road

      0  

    Default


    did you upgrade .jar file and resources files too? Because I had similar problem when I upgraded .jar file and forgot resources(*.css etc.)

  3. #3
    Ext GWT Premium Member
    Join Date
    May 2009
    Posts
    35
    Vote Rating
    0
    yafmbl is on a distinguished road

      0  

    Default


    Thank you dron, upgrading the resources did the trick.

  4. #4
    Sencha User
    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


    I am closing the issue than.

  5. #5
    Ext User
    Join Date
    Dec 2008
    Posts
    5
    Vote Rating
    0
    tslusser is on a distinguished road

      0  

    Default Still occurs in 2.0 final

    Still occurs in 2.0 final


    Hi. I am experiencing this problem still in 2.0 final. I believe the problem is in the adjust heights method as pointed out by a previous post. I don't believe this is related to CSS as I can step through the Java code in a debugger and see the height value incrementing by 1 per each iteration of

    Code:
    for (Head head : heads) {
      if (head.isRendered()) {
        
        int h = head.el().getParent().getHeight();
        /* which ultimately calls a gwt native method Element.getOffsetHeight */
    
    
        head.el().setHeight(h, true);
      }
    }

    so it's not clear to me whether this is a bug in gxt or in gwt?

    I see this issue in both gwt 1.6.4 and 1.7.0

    Thanks,
    Ted

  6. #6
    Sencha User
    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


    Are you sure you are using the latest CSS resources?

  7. #7
    Ext User
    Join Date
    Dec 2008
    Posts
    5
    Vote Rating
    0
    tslusser is on a distinguished road

      0  

    Default css

    css


    I am pretty sure. I have copied over all the CSS, images, themes, etc from the gxt-2.0 download. Is there a particular file timestamp or checksum I can verify?

  8. #8
    Ext User
    Join Date
    Dec 2008
    Posts
    5
    Vote Rating
    0
    tslusser is on a distinguished road

      0  

    Default


    Interesting.... I looked at the header of the gxt-all.css and it states 2.0-M1 as the version. I re-downloaded the gxt-2.0.zip just now and it says 2.0

    I don't know if this was something I did wrong in unpacking the zip file or in the packaging but anyway, my problem is resolved now.

    Thanks,
    Ted

Thread Participants: 3