PDA

View Full Version : removeAll() doesnt remove buttons from Panel



duskandawn
8 Mar 2011, 12:15 PM
hello All,

I am creating a Panel which looks like this :


App.form.Acc = Ext.extend(BaseFormPanel, {

initComponent: function() {
var config = {
buttons: this.buildButtons()

};
Ext.apply(this, Ext.apply(this.initialConfig, config));
App.form.Acc.superclass.initComponent.apply(this, arguments);
},

buildButtons: function() {
return [{
xtype: 'button',
fieldLabel: ' ',
labelSeparator: '',
text: 'Save',
scope: this,
handler: this.saveInfo
}];
},

refreshMyPanel : function(p){
this.removeAll();
this.doLayout();
}

});




I am able to add the items to this panel dynamically, but when i call the refreshMyPanel(), i see all the other dynamically added items being removed, but somehow the button is not removed.
Can you please help why this happening.

Thanks,

mitchellsimoens
8 Mar 2011, 5:15 PM
removeAll only removes child items and buttons are child items. Buttons are child items of the toolbar.