Ext JS removeAll (false) behavior

I use the following code snippet in my application to manage a menu that contains different trees depending on which one is selected. He tries to create tree panels only once and then reuse them if they are selected again, i.e. Maintain the state of extended trees.

var west = Ext.getCmp("west-panel");

        west.removeAll(false);
        west.doLayout();

        var existingPanel = Ext.getCmp('component-tree-project-' + systemId);

        if (existingPanel) {

            west.add(existingPanel);
            west.doLayout();

            return;
        }

//... code to add create and add a new tree panel

The problem is west.removeAll (false), false stops the destruction of nodes, but they do not appear in the panel. The panel adheres to showing what was the last in it.

Using west.removeAll (true) works fine, except that new panels are always created.

+3
source share
1 answer

west.removeAll(true);

0

Source: https://habr.com/ru/post/1754845/


All Articles