extjs中为什么给grid重新赋高度不好使
代码{id:'Arrears',xtype:'grid',layout:'fit',border:false,border:0,height:160,columnLine...
代码
{id: 'Arrears', xtype: 'grid', layout: 'fit', border: false, border: 0, height:160, columnLines: true,
viewConfig: {forceFit: true, stripeRows: true},
columns: [
{ header: '所属单位', dataIndex: "zh", flex: 0.7 },
{ header: '户 名', dataIndex: "hm" }
],
store: Store,
autoScroll: true,
width: '100%'
}//表格代码
//页面加载后执行下面代码
{
var TabPanel1 = Ext.getCmp('TabPanel1').getHeight();
var north2 = Ext.getCmp('north2').getHeight();
var userInfo = Ext.getCmp('userInfo').getHeight();
var south1 = Ext.getCmp('south1').getHeight();
var gridHeight = ((TabPanel1 - north2 - userInfo - south1) / 3).toFixed(2);
Ext.getCmp("Arrears").setHeight(gridHeight);//这条语句无效,不知为什么
} 展开
{id: 'Arrears', xtype: 'grid', layout: 'fit', border: false, border: 0, height:160, columnLines: true,
viewConfig: {forceFit: true, stripeRows: true},
columns: [
{ header: '所属单位', dataIndex: "zh", flex: 0.7 },
{ header: '户 名', dataIndex: "hm" }
],
store: Store,
autoScroll: true,
width: '100%'
}//表格代码
//页面加载后执行下面代码
{
var TabPanel1 = Ext.getCmp('TabPanel1').getHeight();
var north2 = Ext.getCmp('north2').getHeight();
var userInfo = Ext.getCmp('userInfo').getHeight();
var south1 = Ext.getCmp('south1').getHeight();
var gridHeight = ((TabPanel1 - north2 - userInfo - south1) / 3).toFixed(2);
Ext.getCmp("Arrears").setHeight(gridHeight);//这条语句无效,不知为什么
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询