PDA

View Full Version : [Solved] Removing an Ext.draw.Component dynamically



killown
11 Feb 2013, 7:31 AM
I'd like to know how to remove an Ext.draw.Component dynamically
I have the follow example:

Ext.onReady(function() {
var sencha = Ext.create('Ext.draw.Component', {

id: 'test',

width: 300,

height: 300,

resizable: {

dynamic: true,

pinned: true,

handles: 'all'

},

renderTo: Ext.getBody(),







gradients: [{
id: 'grad1'

}],

});

new Ext.create('Ext.Button', {

text: 'position',

renderTo: Ext.getBody(),

handler: function() {

Ext.getCmp("test").IWANTTOREMOVETHECOMPONENT.remove();

andupdateit.update();

},



}).show();



});


I want to remove the component responsible by gradients after press the button, but I didn't find in the API a friendly way to do it

could anyone help me?

killown
11 Feb 2013, 9:13 PM
solved that by using Ext.getCmp('test').destroy()