PDA

View Full Version : Deleting Component



lukefowell89
4 Jan 2011, 6:38 AM
I am making an "edit mode" for a grid, where when you click the grid it becomes editable. This is all fine and works, but the problem I am having is removing the 2 panels that are there to fade out the rest of the components on the canvas and the panel that contains the actions to perform on the grid (buttons to add columns, rows).

.destroy() doesnt appear to be a function of panel
canvas.remove(this) works to an extend, but it will leave the 2 items without their correct width or height at the top of the canvas.

How can I remove them completly, from the screen, the dom and CmpMgr etc etc?

msinn
4 Jan 2011, 7:26 AM
if canvas is the container of your panels you could use canvas.remove('panel1Id', true)
take a look to the remove function in API (http://dev.sencha.com/deploy/dev/docs/?class=Ext.Panel)