1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    2
    Vote Rating
    0
    dimitre is on a distinguished road

      0  

    Default Unanswered: Grid that fills with contentpanel.

    Unanswered: Grid that fills with contentpanel.


    I am trying to create a grid that fills the width of a ContentPanel when brownser is resizing.
    Any ideas?

    Here is my code:

    GroupingView view = new GroupingView();
    view.setEmptyText("No Data");
    view.setForceFit(true);


    grid = new Grid<CampaignResultListGrid>(store, cm);
    grid.setView(view);


    new QuickTip(grid);
    grid.disableTextSelection(false);
    grid.setColumnLines(true);
    grid.setStripeRows(true);
    grid.ensureDebugId("awrgrid");
    grid.setAutoWidth(true);
    initListener();

    mainContent = GWT.create(ContentPanel.class);
    mainContent.setFrame(true);

    mainContent.layout(true);
    mainContent.setLayout(new FitLayout());
    mainContent.setTopComponent(initFilterPanel());
    mainContent.add(grid);


    mainContent.setHeight(Window.getClientHeight() - 98);
    mainContent.setWidth("100%");
    mainContent.ensureDebugId("panelgrid");
    return mainContent;

    Thanks.

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Location
    China
    Posts
    14
    Vote Rating
    0
    Answers
    1
    shingocat is on a distinguished road

      0  

    Default using viewport

    using viewport


    why not use Viewport to be the top container.

    Viewport viewport = new Viewport();
    ContentPanel cp = new ContentPanel();
    Grid grid = new Grid(store,columnModle);
    cp.add(grid);
    viewport.add(cp)

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    2
    Vote Rating
    0
    dimitre is on a distinguished road

      0  

    Default


    Thanks, it's working now.

    I have just forgotten to tell you that i am a new be in GXT.

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,717
    Vote Rating
    107
    Answers
    60
    sven is just really nice sven is just really nice sven is just really nice sven is just really nice

      0  

    Default


    To add some small hint. In the code snippet are two FitLayouts missing. Both viewport and the contentpanel should have a FitLayout set to make the grid resize correctly.