tags:

views:

38

answers:

1

Hello, I'm trying to destroy and render a grid and doesn't work...

var gridCategory = new Ext.grid.GridPanel(...);

I just fire a button called 'Render grid'...

gridCategory.render('gridArea');

and gridCategory.rendered becomes True

so I have a button called 'Destroy grid'

gridCategory.destroy();

and gridCategory.rendered keeps True

and I tried to render again

gridCategory.render('gridArea');

and it fail, doesn't render

what am I doin' wrong? please help

A: 

Once you call destroy on an Ext Component, it cannot be rendered again. All resources (ideally) are released when you call destroy. To display it again, you will need to create a new instance of your grid.

Mike Clark
Indeed, thanks...
Kim Tranjan
You could use the element `initialConfig` property to recreate it, with the Ext.ComponentMgr.
Drasill