GridPanel无法移动表头问题,难道是BUG??

我把一个GridPanel放到TabPanel里面作为它的一个Tab,结果GridPanel中的横滚动条只能够移动表体,无法移动表头?如果把GridPanel单独提出来渲染就没有问题。这是不是ExtJS 3.2的一个BUG?

代码如下:
[code="js"]

var store = new Ext.data.SimpleStore({
data:data,
fields:["id","name","code","shortname","enterprise","orgization","property","level","desc","head","maincontact","ficontact"]
});

var cm = new Ext.grid.ColumnModel([
        {header:"序号",dataIndex:"id",sortable:true},    
        {header:"仓库名称",dataIndex:"name",sortable:true},      
        {header:"仓库代码",dataIndex:"code",sortable:true},
        {header:"仓库简称",dataIndex:"shortname",sortable:true},
        {header:"隶属企业",dataIndex:"enterprise",sortable:true},
        {header:"隶属部门",dataIndex:"orgization"},
        {header:"类型代码",dataIndex:"property"},
        {header:"仓库等级",dataIndex:"level"},
        {header:"仓库性质",dataIndex:"desc"},
        {header:"主要负责人",dataIndex:"head"},
        {header:"主要联系人",dataIndex:"maincontact"},
        {header:"付款联系人",dataIndex:"ficontact"}
        ]);
var gridpanel = new Ext.grid.GridPanel({   
        //title:"仓库基本信息",
        clicksToEdit:2,
cm:cm,   
        store:store,
        autoExpandColumn:11
        });
       
Ext.onReady(function() {
var panel = new Ext.form.FormPanel({
renderTo: 'userinfo',
title: '仓库基础资料',
width: 1024,
height: 768,
bodyStyle: "padding:5px 5px 0", //边距样式
tbar:[
{pressed:false,iconCls:'add',text:'新增'},
{pressed:false,iconCls:'delete',text:"删除"},
{pressed:false,iconCls:'save',text:"保存"},
{pressed:false,iconCls:'check',text:"审核"},
{xtype:'tbseparator'},
{pressed:false,iconCls:'printer',text:"打印"},
{xtype:'tbseparator'},
{pressed:false,iconCls:'import',text:"从Excel导入"},
{pressed:false,iconCls:'export',text:"导出至Excel"},
{xtype:'tbseparator'},
{pressed:false,iconCls:'dataup',text:"上移"},
{pressed:false,iconCls:'datadown',text:"下移"},
{xtype:'tbseparator'},
{pressed:false,iconCls:'comment',text:"发送SMS"},
{pressed:false,iconCls:'email',text:"发送邮件"},
],
items: [
{
layout:'form',
border:false,
items:[
{
xtype:'tabpanel',
plain:true,
activeTab:0,
height:370,
deferredRender: false,
//defaults:{bodyStyle:'padding:1px'},
items:[
{title:'仓库基础资料',items:gridpanel},
{title:'仓库财务资料'}
]
}
]
});
})
[/code]

2个回答

设置一下gridPanel的布局
var gridpanel = new Ext.grid.GridPanel({

//title:"仓库基本信息",

clicksToEdit:2,

cm:cm,

store:store,

autoExpandColumn:11,
[u]layout:'fit',
viewConfig:{
forceFit:true
}[/u]
})

这就要你自己慢慢的调整布局了

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问