Hybrid View

  1. #1
    Ext User
    Join Date
    Feb 2009
    Posts
    4
    Vote Rating
    0
    akashani is on a distinguished road

      0  

    Default Struggling with a simple layout

    Struggling with a simple layout


    Hi everyone,

    I'm evaluating GXT to see whether it'll fit our company's needs. I've created the very simple layout below, which is basically a logo area above a nav bar area. The results are basically as I expect in IE, but not in FF or Chrome. Here's the code:

    Code:
            Viewport view = new Viewport();
            view.setScrollMode(Scroll.AUTO);
    
            LayoutContainer main = new LayoutContainer(new RowLayout(Orientation.VERTICAL));
    
            main.add(new Label("Logo"));
    
            LayoutContainer navbarLayout = new LayoutContainer(new RowLayout(Orientation.HORIZONTAL) );
    
            navbarLayout.add(new Button("B1"));
            navbarLayout.add(new Button("B2"));
            navbarLayout.add(new Button("B3"));
            navbarLayout.add(new Button("B4"));
            navbarLayout.add(new Button("B5"));
    
            main.add(navbarLayout, new RowData(-1, 48));
    
            view.add(main, new MarginData(5, 0, 0, 0));
            
            RootPanel.get().add(view);
    The problem is that the buttons are being given a height of 10px in FF compared to 31px in IE. My understanding was that a RowLayout wouldn't size its children if no RowData was provided, yet they're being sized. Removing the erroneous height (through FireBug) fixes the issue.

    Any ideas?

  2. #2
    Ext User
    Join Date
    Feb 2009
    Posts
    4
    Vote Rating
    0
    akashani is on a distinguished road

      0  

    Default


    Any ideas here? This is just a straightforward example that I'm hoping some glaringly obvious error will jump out at someone.

  3. #3
    Ext User
    Join Date
    Feb 2009
    Posts
    4
    Vote Rating
    0
    akashani is on a distinguished road

      0  

    Default Clarification

    Clarification


    A quick clarification: the Button classes being used are GWT buttons, not GXT buttons. If I change to use GXT buttons, the layout is much more consistent across browsers (though FF has some extra "margins" between the each button).