View Full Version : Remove panels from container panel

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

var childPanel = new Ext.Panel({
//code for creating sub panels


Pls help me to find a solution

18 Aug 2011, 5:19 AM

18 Aug 2011, 9:21 PM
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?