PDA

View Full Version : Remove panels from container panel



prajeesh_bs
18 Aug 2011, 5:11 AM
I have a panel container which contains several sub panels (these sub panels are added dynamically) inside that.
I need to remove all the panels in the container panel when a button is clicked.
how this can be done?


var p = new Ext.Panel({
border: false,
//layout: 'absolute',
autoScroll: true,
margins: '0 0 5 0',
ref: 'containerPanel',
resizable: true
//title: 'Container Panel'
});


childpanels are added dynamically using


containerPanel.add(childPanel);
var childPanel = new Ext.Panel({
//code for creating sub panels

});


Pls help me to find a solution

plalx
18 Aug 2011, 5:19 AM
containerPanel.removeAll();

prajeesh_bs
18 Aug 2011, 9:21 PM
scarsick,
i have used removeAll property earlier, but what happens is that after removing all the items from the container using removeall, when i try to add another panel into the container i am getting the error el.dom is undefined.
i think this is because containerpanel is being removed when removeAll is used.
Any solutions for this?