Results 1 to 2 of 2

Thread: [OPEN-2] [GXT 2.1] [Grid] Hiding columns and columns group with long name

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext GWT Premium Member
    Join Date
    Jul 2008
    Posts
    26

    Default [OPEN-2] [GXT 2.1] [Grid] Hiding columns and columns group with long name

    Hello,

    Detailed description of the problem
    Wrong colums width calculation when hiding columns under columns group with width greater than total columns width under group.
    Sample code demonstrates this issue.

    GXT version
    GXT 2.1, GWT 2.0

    Host mode / web mode / both
    Both

    Browser and version
    Firefox 3.0.16, IE6

    Operating System
    Windows XP SP3

    Sample code
    Code:
    public class Test extends ContentPanel implements EntryPoint {
        
        public void onModuleLoad() {
            final Viewport viewport = new Viewport();
            viewport.setLayout(new FitLayout());
            final ListStore<BaseModelData> store = new ListStore<BaseModelData>();
            for(int i=0; i < 10; i++){
                BaseModelData model = new BaseModelData();
                for(int j=0; j < 4; j++){
                    model.set("Property" + j, "Value#" + i + "#" + j);
                }
                store.add(model);
            }
            final List<ColumnConfig> columns = new ArrayList<ColumnConfig>();
            for(int i=0; i < 4; i++){
                ColumnConfig config = new ColumnConfig("Property" + i, "Property" + i, 80);
                config.setWidth(70);
                config.setEditor(new CellEditor(new TextField<String>()));
                columns.add(config);
            }
            ColumnModel cm = new ColumnModel(columns);
            for(int i=0; i < 2; i++){
                cm.addHeaderGroup(0, i*2, new HeaderGroupConfig("Group" + i + " Long Name", 1, 2));
            }
            final EditorGrid<BaseModelData> grid = new EditorGrid<BaseModelData>(store, cm);
            grid.setWidth(900);
            grid.setHeight(600);
            this.addButton(new Button("Hide Columns", new SelectionListener<ButtonEvent>() {
                public void componentSelected(ButtonEvent ce) {
                    int[] toHideIdxs = {1, 3};
                    for(int i=0; i < toHideIdxs.length; i++){
                        grid.getColumnModel().setHidden(toHideIdxs[i], true);
                    }
                }
            }));
            
            this.addButton(new Button("Show Columns", new SelectionListener<ButtonEvent>() {
                public void componentSelected(ButtonEvent ce) {
                    int[] toHideIdxs = {1, 3};
                    for(int i=0; i < toHideIdxs.length; i++){
                        grid.getColumnModel().setHidden(toHideIdxs[i], false);
                    }
                }
            }));
            this.add(grid);
            
    
            viewport.add(this);
            RootPanel.get().add(viewport);
        }
        
    }
    Thanks.
    Last edited by Alex.Leshkin; 21 Dec 2009 at 3:27 AM. Reason: sample code tags

  2. #2
    Sencha User
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242

    Default

    We have verified the bug and are working on a fix. Thanks for the sample code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •