Hybrid View

  1. #1
    Ext User
    Join Date
    May 2008
    Posts
    27
    Vote Rating
    0
    Daniel Kurka is on a distinguished road

      0  

    Default Accordion Panel not sizing proberly

    Accordion Panel not sizing proberly


    I am using a Borderlayout.

    In the west area of the borderlayout i would like to use a accordion layout.
    the west area should be scrollable depending of the content in the accordion.
    also the accordion should use all the width in the west panel.
    everything seems to work fine, but if you open the app for the first time the height of the accordion is wrong and you cant get it to display the content.

    i attached a little demo code:

    Code:
    package com.dvelop.d3web.client;
    
    import com.extjs.gxt.ui.client.Style.LayoutRegion;
    import com.extjs.gxt.ui.client.util.Margins;
    import com.extjs.gxt.ui.client.widget.LayoutContainer;
    import com.extjs.gxt.ui.client.widget.ContentPanel;
    import com.extjs.gxt.ui.client.widget.Viewport;
    import com.extjs.gxt.ui.client.widget.layout.AccordionLayout;
    import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
    import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
    import com.extjs.gxt.ui.client.widget.layout.FitLayout;
    import com.extjs.gxt.ui.client.widget.layout.FillLayout;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.Element;
    import com.google.gwt.user.client.ui.RootPanel;
     
    import com.extjs.gxt.ui.client.Style.Scroll;
    
    public class Explorer extends LayoutContainer implements EntryPoint {
    
        public void onModuleLoad() {
            Viewport v = new Viewport();
            v.add(this);
            v.layout(true);
            v.setLayout(new FitLayout());
            RootPanel.get().add(v);
        }
    
        public Explorer() {
            setData("layout", new FitLayout());
            
            
        }
    
        @Override
        protected void onRender(Element parent, int pos) {
            super.onRender(parent, pos);
            setLayout(new BorderLayout());
    
            ContentPanel north = new ContentPanel();
            ContentPanel west = new ContentPanel();
            west.setHeading("Navigation");
            west.setScrollMode(Scroll.AUTO);
            
            ContentPanel accordionPanel = new ContentPanel();
            accordionPanel.setBodyBorder(false);
            accordionPanel.setHeaderVisible(false);
            
            accordionPanel.setAutoWidth(true);
            accordionPanel.setAutoHeight(true);
            
            AccordionLayout accordionLayout = new AccordionLayout();
            
            
            accordionLayout.setFill(false);
            //accordionLayout.setActiveOnTop(true);
            accordionPanel.setLayout(accordionLayout);
            //setIconStyle("icon-accordion");
            
            
            
            
            
            ContentPanel cp = new ContentPanel();
            cp.setHeading("Online Users");
            
    
            cp.addText("asdfasdf<br>asdfasdf<br>asdfasdf<br>asdfasdf<br>");
            accordionPanel.add(cp);
            
            
            
            cp = new ContentPanel();
            cp.setHeading("Settings");
            cp.addText("blab alb alba");
            accordionPanel.add(cp);
    
            cp = new ContentPanel();
            cp.setHeading("Stuff");
            cp.addText("blab alb alba");
            accordionPanel.add(cp);
    
            cp = new ContentPanel();
            cp.setHeading("More Stuff");
            cp.addText("blab alb alba");
            accordionPanel.add(cp);
            
            west.add(accordionPanel, new FitLayout());
            
            ContentPanel center = new ContentPanel();
            ContentPanel east = new ContentPanel();
            ContentPanel south = new ContentPanel();
    
            BorderLayoutData northData = new BorderLayoutData(LayoutRegion.NORTH,
                    100);
            northData.setSplit(true);
            northData.setMargins(new Margins(5, 5, 0, 5));
    
            BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST, 200);
            westData.setSplit(true);
            westData.setCollapsible(true);
            westData.setMargins(new Margins(5));
            westData.setFloatable(true);
            westData.setMinSize(150);
            westData.setMaxSize(400);
            
    
            BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);
            centerData.setMargins(new Margins(5, 0, 5, 0));
    
            BorderLayoutData eastData = new BorderLayoutData(LayoutRegion.EAST, 200);
            eastData.setSplit(true);
            eastData.setCollapsible(true);
            eastData.setMargins(new Margins(5));
    
            BorderLayoutData southData = new BorderLayoutData(LayoutRegion.SOUTH,
                    100);
            southData.setSplit(true);
            southData.setMargins(new Margins(0, 5, 5, 5));
            
            
            
            
            add(north, northData);
            add(west, westData);
            add(center, centerData);
            add(east, eastData);
            add(south, southData);
            
    
        }
    
    }

  2. #2
    Ext User
    Join Date
    Apr 2008
    Location
    Munich, Germany
    Posts
    43
    Vote Rating
    0
    flow is on a distinguished road

      0  

    Default


    Hi Daniel,

    which version of GXT do you use? For me (GXT Beta 4) everything looks fine.
    I attached a screenshot.
    Attached Images

  3. #3
    Ext User
    Join Date
    May 2008
    Posts
    27
    Vote Rating
    0
    Daniel Kurka is on a distinguished road

      0  

    Default


    this was done with beta-3. im gonna check this out with beta-4 if i have time
    thanks anyway

  4. #4
    Ext GWT Premium Member
    Join Date
    Mar 2008
    Posts
    87
    Vote Rating
    0
    EvilTed is on a distinguished road

      0  

    Default setActiveOnTop not working either?

    setActiveOnTop not working either?


    I have a content panel and set the AccordianLayout in the overidden onRender() method like so:

    @Override
    protected void onRender(Element parent, int pos) {
    super.onRender(parent, pos);
    AccordionLayout layout = new AccordionLayout();
    layout.setActiveOnTop(true);
    layout.setHideCollapseTool(true);
    layout.setTitleCollapse(true);
    setLayout(layout);

    The calls to setHideCollapseTool() and setTitleCollapse() both work, but the call to setActiveOnTop() doesn't appear to do anything?

    Can someone please look at this and verify?

    Thanks

    ET

  5. #5
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    2
    gslender is on a distinguished road

      0  

    Default


    You are right - setActiveOnTop does nothing in the AccordionLayout code - so I'm guessing its not implemented - which would be a bug.

    Please post under the bug forum so it gets attended to...

  6. #6
    Ext GWT Premium Member
    Join Date
    Mar 2008
    Posts
    87
    Vote Rating
    0
    EvilTed is on a distinguished road

      0  

    Default


    Will do,

    Thnx m8

    ET

Thread Participants: 3

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