Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    15
    Vote Rating
    0
    CHEM_Eugene is on a distinguished road

      0  

    Default I can't remove gxt grid component from ContentPanel

    I can't remove gxt grid component from ContentPanel


    Hello!

    I have a view (in the mvp4g paradigm) which extends com.google.gwt.user.client.ui.Composite. In this view I made initWidget(grid). This view is added to ContentPanel component.
    When I change views I do: contentPanel.removeAll() and contentPanel.add(newView).
    It result in newView is added to ContentPanel, but grid isn't disappear. Moreother, grid becomes inactive. I can't select a row or resize header.

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    15
    Vote Rating
    0
    CHEM_Eugene is on a distinguished road

      0  

    Default


    Workaround was found:

    If I wrap grid with com.google.gwt.user.client.ui.FlowPanel, the removing works fine!

  3. #3
    Sencha User WesleyMoy's Avatar
    Join Date
    Oct 2009
    Location
    Redwood City, California
    Posts
    402
    Vote Rating
    2
    WesleyMoy is on a distinguished road

      0  

    Default


    I can't seem to replicate this issue. ContentPanel doesn't have removeAll, so I used clear, and this seems to work just fine for removing a simple Composite consisting of a Grid.

    What browser and OS are you using? Are you having this issue with development mode, production mode, or both? Also, would you be able to provide a simplified code example that implements EntryPoint?

  4. #4
    Sencha User
    Join Date
    Feb 2012
    Posts
    15
    Vote Rating
    0
    CHEM_Eugene is on a distinguished road

      0  

    Default


    ContentPanel doesn't have removeAll, so I used clear
    com.extjs.gxt.ui.client.widget.ContentPanel doesn't have clear method.

    I have a bug in all browsers, production and dev. mode, Windows 7, gxt 2.2.5

    EntryPoint code:

    Code:
    public void onModuleLoad() {
                    
            Mvp4gModule module = (Mvp4gModule) GWT.create(Mvp4gModule.class);
            module.createAndStartModule();
            
            final Viewport v = new Viewport();
            v.setLayout(new FitLayout());
            v.add((Widget) module.getStartView());
            RootLayoutPanel.get().add(v);
    
        }
    Problem class:

    Code:
    public class MainView extends LayoutContainer implements
            MainPresenter.MainViewInterface, ReverseViewInterface<MainPresenter> {
    
    import com.extjs.gxt.ui.client.widget.ContentPanel;
    import com.extjs.gxt.ui.client.widget.LayoutContainer;
    
    private ContentPanel mainPanel = new ContentPanel();
    private Widget defaultMainBody;
    private Widget activeView;
    
    public void setDefaultMainBody() {
            if (!defaultMainBody.equals(activeView)) {
                mainPanel.removeAll();
                mainPanel.setHeading(getModuleTitle());
                activeView = defaultMainBody;
                mainPanel.add(defaultMainBody);
                layout();
            }
        }
    }

  5. #5
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This is the GXT 3 bug forums, you are using GXT 2. I moved this thread to the proper location.

  6. #6
    Sencha User
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Can you please post a fully working testcase implementing EntryPoint without a reference to mvp4g?

Thread Participants: 2

Tags for this Thread