如果有人感兴趣,这是我的解决方案:这绝对不是理想的,非常hacky,但它似乎工作正常。也许有人会更好地了解我现在要完成的工作,并且可以提出更好的实现:-)
Ext.define('Ext.tab.AutoHeightPanel', {
extend: 'Ext.tab.Panel',
alias: 'widget.autoheighttabs',
constructor: function(cnfg){
this.callParent(arguments);
this.initConfig(cnfg);
this.on('afterlayout', this.forceAutoHeight, this);
this.on('afterrender', this.forceAutoHeight, this);
this.on('resize', this.forceAutoHeight, this);
},
forceAutoHeight: function(){
this.getEl().applyStyles({height : 'auto', overflow : 'visible'});
this.items.each(function(item, idx, len) {
if(Ext.isDefined(item.getEl())) item.getEl().applyStyles({height : 'auto', overflow : 'visible'});
});
}
});
您可能希望在style
选项卡面板的配置中添加一个“margin-bottom”值,以防止内容与面板底部对接。