Hybrid View

  1. #1
    Ext GWT Premium Member
    Join Date
    Sep 2009
    Posts
    29
    Vote Rating
    0
    Jerome C. is on a distinguished road

      0  

    Default [CLOSED] AccordionLayout and HBoxLayout

    [CLOSED] AccordionLayout and HBoxLayout


    Hello,

    I can't find a solution to add HBoxLayout panels in an accordion. The size of these panels is not good.

    I think it's a bug.

    Example:

    Code:
            // create the accordion layout
            AccordionLayout layout = new AccordionLayout();
    
            // create root element
            LayoutContainer root = new LayoutContainer();
            root.setLayout(layout);
    
            // add the root to the current panel
            add(root);
    
            // create two sections in this accordion
            final ContentPanel toBuy = new ContentPanel();
            final ContentPanel owned = new ContentPanel();
    
            // add it to accordion panel
            root.add(toBuy);
            root.add(owned);
    
            // make the second active
            layout.setActiveItem(owned);
    
            // create a new item with HBoxLayout
            LayoutContainer item = new LayoutContainer(new HBoxLayout());
    
            // make the first element flex
            HBoxLayoutData layoutDatas = new HBoxLayoutData();
            layoutDatas.setFlex(1);
    
            // add two texts
            item.add(new Text("test"), layoutDatas);
            item.add(new Text("anotherItem"));
    
            // create a new item with HBoxLayout
            LayoutContainer item1 = new LayoutContainer(new HBoxLayout());
    
            // make the first element flex
            HBoxLayoutData layoutDatas1 = new HBoxLayoutData();
            layoutDatas1.setFlex(1);
    
            // add two texts
            item1.add(new Text("test"), layoutDatas1);
            item1.add(new Text("anotherItem"));
    
            // add this item in toBuy panel
            toBuy.add(item);
            toBuy.add(item1);
    
            // do the same for owned panel
            // create a new item with HBoxLayout
            LayoutContainer item2 = new LayoutContainer(new HBoxLayout());
    
            // make the first element flex
            HBoxLayoutData layoutDatas2 = new HBoxLayoutData();
            layoutDatas2.setFlex(1);
    
            // add two texts
            item2.add(new Text("test"), layoutDatas);
            item2.add(new Text("anotherItem"));
    
            // add this item in toBuy panel
            owned.add(item2);
    
            // layout the root
            layout();
    when I do it, I can't see the second text "anotherItem". If I use the "Inspect element" in hosted mode, I can see the flex element "test" has a big width, so the anotherItem can't be see.

    How can I achieve to have an accordion and a succession of HBoxLayout on its panels ?

    thanks

  2. #2
    Ext GWT Premium Member
    Join Date
    Sep 2009
    Posts
    29
    Vote Rating
    0
    Jerome C. is on a distinguished road

      0  

    Default


    Anyone here to help me ?

    thanks

  3. #3
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    HBoxLayout is only in GXT 2.0. If you are still having issues please submit a post in the 2.0 forums.

Thread Participants: 1