Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Dec 2008
    Location
    Munich, Germany
    Posts
    183
    Vote Rating
    0
    Jose Jeria is an unknown quantity at this point

      0  

    Default [CLOSED] Grid column width is incorrect if grid is hidden store is added

    [CLOSED] Grid column width is incorrect if grid is hidden store is added


    • GWT 2.0.3
    • GXT - Latest 2.2 build
    • Windows 7

    I noticed that the column width of a grid will be incorrect if the store is updated while the grid has been removed from the layout.

    Steps to reproduce:
    1. Click on "Add items to Grid" button, notice that elements will be correctly added
    2. Click on "Remove Panel"
    3. Click on "Add Panel" and notice that the column width is still correct
    4. Now click on "Remove Panel" again
    5. Then "Add items to Grid" button
    6. Then finally re-add the panel by clicking "Add Panel"
    Now notice that the grid column width is not correct. Would this be a bug or is there any way to correct this issue somehow?

    Thanks

    Code:
    public class GridColumnDemo extends LayoutContainer {
        private ContentPanel panel;
        private ListStore<ModelData> store;
    
        public GridColumnDemo() {
            Button removeBtn = new Button("Remove Panel", new SelectionListener<ButtonEvent>() {
                @Override
                public void componentSelected(ButtonEvent ce) {
                    remove(panel);
                }
            });
    
            Button addBtn = new Button("Add Panel", new SelectionListener<ButtonEvent>() {
                @Override
                public void componentSelected(ButtonEvent ce) {
                    add(panel);
                    layout();
                }
            });
    
            Button addStoreBtn = new Button("Add items to Grid", new SelectionListener<ButtonEvent>() {
                @Override
                public void componentSelected(ButtonEvent ce) {
                    addStore();
                }
            });
    
            panel = new ContentPanel();
            panel.setHeading("Bug?");
            panel.setLayout(new FitLayout());
            panel.setHeight(200);
            panel.setWidth(500);
    
            store = new ListStore<ModelData>();
            Grid<ModelData> grid = new Grid<ModelData>(store, getColumnModel());
            grid.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
            grid.setStripeRows(true);
            grid.setAutoExpandColumn("name");
            grid.setAutoExpandMax(2000);
            grid.setAutoExpandMin(100);
            grid.setLoadMask(true);
    
            panel.add(grid);
    
            add(addBtn);
            add(removeBtn);
            add(addStoreBtn);
            add(panel);
        }
    
        private void addStore() {
            List<ModelData> models = new ArrayList<ModelData>();
    
            for (int i = 0; i < 5; i++) {
                Animal animal = new Animal();
                animal.set("name", "Animal nr. " + i);
    
                models.add(animal);
            }
    
            store.removeAll();
            store.add(models);
        }
    
        private ColumnModel getColumnModel() {
            List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
    
            ColumnConfig column = new ColumnConfig("name", "Name", 497);
            configs.add(column);
    
            return new ColumnModel(configs);
        }
    }
    
    class Animal extends BaseModel {
    
    }

  2. #2
    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


    Well, when something is not there, it has no dimensions. This means it cannot be layouted.

    When readding the grid, call refresh on the gridview.

    We are looking into changing internals, so that layouting will work in much more cases also if it is hidden. These changes are going into GXT3

    But thanks for this details report, as always

  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


    Code:
     Button addBtn = new Button("Add Panel", new SelectionListener<ButtonEvent>() {
                @Override
                public void componentSelected(ButtonEvent ce) {
                    add(panel);
                    layout();
    grid.getView().refresh(false);
                }
            });

  4. #4
    Sencha Premium Member
    Join Date
    Dec 2008
    Location
    Munich, Germany
    Posts
    183
    Vote Rating
    0
    Jose Jeria is an unknown quantity at this point

      0  

    Default


    Ah.. that makes sense. Thanks!

Similar Threads

  1. [2.??][CLOSED] ComboBox display incorrect width
    By freddys in forum Ext 2.x: Bugs
    Replies: 3
    Last Post: 2 Dec 2009, 4:29 AM
  2. Replies: 13
    Last Post: 6 Aug 2009, 4:31 AM
  3. [CLOSED][3.0rc2] extra nested hbox leads to incorrect width
    By bobthebuilder in forum Ext 3.x: Bugs
    Replies: 3
    Last Post: 26 Jun 2009, 5:07 PM
  4. Grid column widths not correct when grid is initially rendered in a hidden div
    By Zeus_Apollo in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 8 Jun 2009, 8:41 AM
  5. Need help! Hidden column/Data store /Grid
    By pokerking400 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 15 May 2008, 9:12 AM

Thread Participants: 1

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