Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-3243 in 3.1 beta.
  1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    4
    Vote Rating
    0
    Foxtrot is on a distinguished road

      0  

    Default Grid renders diffrent in fieldset on setHideHeaders(true or false)

    Grid renders diffrent in fieldset on setHideHeaders(true or false)


    Required Information

    Version(s) of Ext GWT
    3.0.1

    Browser versions and OS
    (and desktop environment, if applicable)
    • All browsers - Windows

    Virtual Machine
    No

    Description
    Im expecting that the grid would autofit the fieldset but it does not perform a resize when setHideHeaders(true) is used. When setHideHeaders(false) (default) the grid shows as expected

    Run mode
    Development mode

    Steps to reproduce the problem
    1. Start running in development mode in Eclipse
    2. Open app in browser
    3. Observe

    Expected result
    The following screenshot but without the headerbars:
    2013-08-18 22_24_28.png

    Actual result
    when setting the grid.setHideHeaders(true)

    2013-08-18 22_24_45.png

    Test case
    Code:
    public class UserGrid extends Composite{
        private static final UserProperties properties = GWT.create(UserProperties.class);
        private Grid<User> grid;
        
        public UserGrid() {
            createGrid();
        }
        
        private void createGrid(){
            ColumnConfig<User, User> ccUser = new ColumnConfig<User, User>(new IdentityValueProvider<User>());
            ccUser.setCell(new AbstractCell<User>() {
    
                @Override
                public void render(com.google.gwt.cell.client.Cell.Context context,
                        User value, SafeHtmlBuilder sb) {
                    sb.appendEscaped(value.getUsername());
                }
            });
            
            ColumnConfig<User, String> ccName = new ColumnConfig<User, String>(properties.lastname(),200,"Lastname");
            ccName.setFixed(true);
            ccName.setWidth(200);
            
            final ArrayList<ColumnConfig<User,?>> ccList = new ArrayList<ColumnConfig<User,?>>();
            ccList.add(ccUser);
            ccList.add(ccName);
            
            grid = new Grid<User>(new ListStore<User>(properties.username()), new ColumnModel<User>(ccList));
            grid.setBorders(true);
            //Cause of wrong renderning
            grid.setHideHeaders(true);
            grid.getView().setForceFit(true);
            grid.getView().setColumnLines(true);
            initWidget(grid);
        }
        
        /**
         * Clears the records in the grid
         */
        public void clear(){
            grid.getStore().clear();
        }
        
        public void addAll(List<User> users){
            grid.getStore().addAll(users);
        }
    
    
    }
    in entrypoint :
    Code:
            fsRoot = new FieldSet();
            fsRoot.setHeadingText("Users");
            grid = new UserGrid();
            fsRoot.setWidget(grid);
            
            //add to rootpanel
    Debugging already done
    • Tracked down the cause to the setheader method
    • tried adding forcelayout() does not work

    Possible fix
    • Manually make the browser 1px greater (in witdh). (Missing resize event ?)

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    279
    Vote Rating
    9
    branflake2267 will become famous soon enough

      0  

    Default


    Thanks for reporting. This issue has been submitted and a fix is on the way in. We will update the thread when progress is made.

    In the mean time here is a workaround:
    1. add this class with an override of GridView, which fixes the hide header logic.
    Code:
    public class GridViewExt<M> extends GridView<M> {
        @Override
        protected void layout(boolean skipResize) {
          if (body == null) {
            return;
          }
     
          XElement c = grid.getElement();
          Size csize = c.getStyleSize();
     
          int vw = csize.getWidth();
          // the workaround adds & !grid.isHideHeaders()
          if (vw < 10 || (csize.getHeight() < 20 && !grid.isHideHeaders())) {
            return;
          }
     
          if (!skipResize) {
            resize();
          }
     
          if (forceFit || autoFill) {
            if (lastViewWidth != vw) {
              fitColumns(false, false, -1);
              header.updateTotalWidth(getOffsetWidth(), getTotalWidth());
              if (footer != null) {
                footer.updateTotalWidth(getOffsetWidth(), getTotalWidth());
              }
              lastViewWidth = vw;
            }
          } else {
            autoExpand(false);
            header.updateTotalWidth(getOffsetWidth(), getTotalWidth());
            if (footer != null) {
              footer.updateTotalWidth(getOffsetWidth(), getTotalWidth());
            }
            syncHeaderScroll();
          }
        }
      }



    2. Implement the workaround like this, instead instantiating the GridViewExt<M> with workaround.
    Code:
    GridView<StateTestModel> gridView = new GridViewExt<StateTestModel>();
    Grid<StateTestModel> grid = new Grid<StateTestModel>(listStore, cm, gridView);
    Just a note, the parent needs to be in the GXT layout chain for resize events to get passed to the FieldSet.

    Brandon

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    279
    Vote Rating
    9
    branflake2267 will become famous soon enough

      0  

    Default


    This issue has been fixed and merged into the 3.1 branch. It is scheduled for release in the not to distant future.

    Brandon

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar