52,797
社区成员
发帖
与我相关
我的任务
分享
var grid_person = new Ext.grid.GridPanel({
store:store, // store与sm在前面均已定义
sm: sm,
title:"查看I表_t_person",
//autoHeight:true, // 尝试了很多方法,都不显示横向滚动条
//autoWidth:true,
//width:800,
//height: 500,
//width: Ext.get("div-grid").getWidth(),
// height: Ext.get("div-grid").getHeight(),
autoScroll:true,
//layout:'fit',
containerScroll : true,
cm: new Ext.grid.ColumnModel
([
//new Ext.grid.RowNumberer(),
sm,
{header:"id",dataIndex:"id",sortable:true,width:10},
//{header:"pid",dataIndex:"pid",sortable:true,width:10},
{header:"code",dataIndex:"code",sortable:true,width:30},
{header:"ucode",dataIndex:"ucode",sortable:true,width:30},
{header:"pcode",dataIndex:"pcode",sortable:true,width:30},
{header:"英文姓",dataIndex:"last_name",width:13,tooltip:"last name",sortable:true,width:10},
{header:"英文名",dataIndex:"first_name",tooltip:"first name",sortable:true,width:10},
{header:"国籍",dataIndex:"nationality",tooltip:"国籍/nationnality",sortable:true,width:10},
{header:"性别",dataIndex:"sex",tooltip:"sex",sortable:true,width:10,
renderer: function(v){
if(v == "0"){
return "<img src='../files/images/icons/man.gif'>";
}else{
return "<img src='../files/images/icons/woman.gif'>";
}
}
},
{header:"出生日期",dataIndex:"birth",tooltip:"出生日期",sortable:true,width:10},
{header:"出生地",dataIndex:"birth_place",tooltip:"出生地",sortable:true,width:10},
{header:"身高",dataIndex:"height",tooltip:"身高",sortable:true,width:10},
{header:"体重",dataIndex:"weight",tooltip:"体重",sortable:true,width:10},
{header:"居住住址",dataIndex:"address",tooltip:"居住地址",sortable:true,width:10},
/*.....
....这里省略其他的Column,约30多条*/
]),
viewConfig:
{
//width:500,
//autoScroll:true,
forceFit:true,
scrollOffset:2 // Grid按钮将不会显示上下滚动条
},
tbar[], // 省略,删除查询等
bbar[], //省略,分页
var viewport = new Ext.Viewport({
layout:'fit',//设置 viewport里面的item在viewport中的布局方式
//animate:true,
//width: Ext.get("div-grid").getWidth(),
//height: Ext.get("div-grid").getHeight(),
width:600,
autoScroll:true,
items:[grid_person]
});