Condor
04-24-2009, 07:58 AM
Can the Ext.Panel buttons config option be made to support ' ', '-' and '->', just like tbar and bbar?
Suggested fix:
Ext.override(Ext.Panel, {
initComponent : function(){
Ext.Panel.superclass.initComponent.call(this);
this.addEvents(
'bodyresize',
'titlechange',
'iconchange',
'collapse',
'expand',
'beforecollapse',
'beforeexpand',
'beforeclose',
'close',
'activate',
'deactivate'
);
if(this.unstyled){
this.baseCls = 'x-plain';
}
if(this.tbar){
this.elements += ',tbar';
if(Ext.isObject(this.tbar)){
this.topToolbar = this.tbar;
}
delete this.tbar;
}
if(this.bbar){
this.elements += ',bbar';
if(Ext.isObject(this.bbar)){
this.bottomToolbar = this.bbar;
}
delete this.bbar;
}
if(this.header === true){
this.elements += ',header';
delete this.header;
}else if(this.title && this.header !== false){
this.elements += ',header';
}
if(this.footer === true){
this.elements += ',footer';
delete this.footer;
}
if(this.buttons){
this.elements += ',footer';
var btns = this.buttons;
this.buttons = [];
for(var i = 0, len = btns.length; i < len; i++) {
if(typeof btns[i] == 'string' || btns[i].render){
this.buttons.push(btns[i]);
}else if(btns[i].xtype){
this.buttons.push(Ext.create(btns[i], 'button'));
}else{
this.addButton(btns[i]);
}
}
}
if(this.fbar){
this.elements += ',footer';
}
if(this.autoLoad){
this.on('render', this.doAutoLoad, this, {delay:10});
}
}
});
Suggested fix:
Ext.override(Ext.Panel, {
initComponent : function(){
Ext.Panel.superclass.initComponent.call(this);
this.addEvents(
'bodyresize',
'titlechange',
'iconchange',
'collapse',
'expand',
'beforecollapse',
'beforeexpand',
'beforeclose',
'close',
'activate',
'deactivate'
);
if(this.unstyled){
this.baseCls = 'x-plain';
}
if(this.tbar){
this.elements += ',tbar';
if(Ext.isObject(this.tbar)){
this.topToolbar = this.tbar;
}
delete this.tbar;
}
if(this.bbar){
this.elements += ',bbar';
if(Ext.isObject(this.bbar)){
this.bottomToolbar = this.bbar;
}
delete this.bbar;
}
if(this.header === true){
this.elements += ',header';
delete this.header;
}else if(this.title && this.header !== false){
this.elements += ',header';
}
if(this.footer === true){
this.elements += ',footer';
delete this.footer;
}
if(this.buttons){
this.elements += ',footer';
var btns = this.buttons;
this.buttons = [];
for(var i = 0, len = btns.length; i < len; i++) {
if(typeof btns[i] == 'string' || btns[i].render){
this.buttons.push(btns[i]);
}else if(btns[i].xtype){
this.buttons.push(Ext.create(btns[i], 'button'));
}else{
this.addButton(btns[i]);
}
}
}
if(this.fbar){
this.elements += ',footer';
}
if(this.autoLoad){
this.on('render', this.doAutoLoad, this, {delay:10});
}
}
});