研究了一整天终于搞定了 我没有使用网上的那些div之类的 我的思想很简单就是在gridpanel所在的容器显示之前获得容器内部的高度 通过这个高度来做一个参考设定其气元素gridpanel的高度,部分代码如下
Crim.monitorwarnning.enterpriseUniteView.QiYeFenHongDetailsWindow.superclass.constructor.call(this, Ext.applyIf(config, {
title: '企业分红信息',
iconCls: 'icon-moreinfo',
resizable: false,
width: 650,
height: 420,
autoScroll: true,
/// plain: true,
layout: "border",
closeAction: 'close',
modal: true,
defaults: {
baseCls: 'x-plain'
},
items: [{
region:"north",
//layout: "form",
margins: "5 5 5 5",
border: true,
iconCls: 'panel-search-icon',
items: [new Crim.monitorwarnning.enterpriseUniteView.QiYeFenHongFormPanel({
id:"中国软件分红"
})]
},{
region:'center',
layout: "border",
border: true,
iconCls: 'panel-search-icon',
items: [{
region:"west",
border:true,
layout:"border",
margins: "0 5 5 5",
width:"50%",
//autoHeight:true,
iconCls: 'panel-search-icon',
id:"westPanel",
items: [{
region:"center",
border:true,
//layout:"fit",
//margins: "0 5 5 5",
//width:"50%",
autoHeight:true,
iconCls: 'panel-search-icon',
//id:"westPanel",
//这个是gridpanel 我自己封装的ext类
items:new Crim.monitorwarnning.enterpriseUniteView.FenHongGridPanel({
id:"1212"
})
}]
},{
region:"center",
margins: "0 5 5 0",
border: true,
layout:"fit",
iconCls: 'panel-search-icon',
items: pieCharPanel
}]
}]
}));
this.on('close', function(win){
win.hide();
return false;
}, this);
//这是实现的核心
this.on("beforeshow",function(){
alert(Ext.getCmp("westPanel").getSize().height);
Ext.getCmp("1212").setHeight(Ext.getCmp("westPanel").getSize().height-100);
});
}
不明白的可以留言