Hybrid View

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    16
    Vote Rating
    0
    sajjan.sarkar is on a distinguished road

      0  

    Default GXT ContentPanel not resizing when window is resized

    GXT ContentPanel not resizing when window is resized


    I am not able to make a contentpanel resize when the browser is resized. The below code renders the content panel to fill the screen(desired) but doesnt resize when the browser window size is changed.

    Code:
     public void onModuleLoad() {
         RootPanel rootPanel = RootPanel.get();
         Viewport viewPort = new Viewport();
         final Layout layout = new FitLayout();
         ContentPanel resultPanel = new ContentPanel();
         resultPanel.setHeading("Result");
         resultPanel.setFrame(true);
         resultPanel.setLayout(layout);
         resultPanel.setScrollMode(Scroll.ALWAYS);
         resultPanel.addButton(new Button("OK"));
         resultPanel.setWidth("100%");
         LayoutContainer page = new LayoutContainer(new RowLayout(Orientation.VERTICAL));
         page.add(resultPanel, new com.extjs.gxt.ui.client.widget.layout.RowData(1, -1));
         viewPort.add(page);
    
    
         rootPanel.add(viewPort);
         page.layout();
    
    
     }

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    16
    Vote Rating
    0
    sajjan.sarkar is on a distinguished road

      0  

    Default [SOLVED] Viewport needed a fitlayout

    [SOLVED] Viewport needed a fitlayout


    Found the answer, so updating here.

    I needed to add
    Code:
    viewPort.setLayout(new FitLayout());
    Thanks Colin Alworth from SO.