Ext.Panel.prototype.addButton = function(config, handler, scope) { var bc = { handler : handler, scope : scope, hideParent : true }; if (typeof config == "string") { bc.text = config; } else { Ext.apply(bc, config); } var btn; if (config.xtype) { btn = Ext.ComponentMgr.create(bc,config.xtype); } else { bc.minWidth = this.minButtonWidth, btn = new Ext.Button(bc); } if (!this.buttons) { this.buttons = []; } this.buttons.push(btn); return btn; };