首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

EXT从数据库读数据,数据条目太多亟需加滚动条,求高手解决

2012-09-10 
EXT从数据库读数据,数据条目太多需要加滚动条,求高手解决/**** @class EdiEntJbxxView* @extends Ext.Pane

EXT从数据库读数据,数据条目太多需要加滚动条,求高手解决
/**
 * 
 * @class EdiEntJbxxView
 * @extends Ext.Panel
 */

EdiEntJbxxView=Ext.extend(Ext.Panel,{
constructor:function(config){
Ext.applyIf(this,config);
this.initUIComponents();
EdiEntJbxxView.superclass.constructor.call(this,{
id : 'EdiEntJbxxView',
title : '项目基本信息',
iconCls:'menu-appuser',
layout:'border',
autoScroll:true,

});
},
initUIComponents:function(){
this.initGridPanel();

this.items=[this.gridPanel];
}});


EdiEntJbxxView.prototype.initGridPanel=function(){

   
var store = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({
url : __ctxPath + '/edi/queryAllEdiEntJbxx.do'
}),
reader : new Ext.data.JsonReader({
root : 'result',
totalProperty : 'totalCounts',
fields : [{
name : 'id',
type : 'long'
},{
name:'soaType',
type:'short'
},'soaName',
'interfaceSourceId',
'interfaceFromSourceId',
'hastrasfer',
'requestId',
'responseId',
'bussinessId',
{
name:'submitDate',
type:'date'
},
{
name:'dealDate',
type:'date'
},'entXmbh',
'entCbsjgspfdw',
'entCbsjgsspwh',
'entLxny',
'entJsdd',
'entJsxz',
'entJsgm',
'entLxwh',
'entHyzgzzjgdm',
'entHyzgmc',
'entXmyzzzjgdm',
'entXmyzmc',
'entTzgm',
'entJszq',
'entZjly',
'entXmgk',
'entXmsjdw',
'entXmcjdw',
'entXmjldw',
'entSjzj',
'entXmjl',
'entJlzj',
'entBz',
'entXxtjdwzjjgdm',
'entXxtjdw_name',
'entSjzt',
'entJlcssj',
'attributy1',
'attributy2',
'attributy3',
'attributy4'


]
}),
remoteSort : true
});
store.setDefaultSort('id', 'asc');

store.load({
params : {
start : 0,
limit : 25
}
});
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel({
columns : [sm, new Ext.grid.RowNumberer(), {
header : 'id',
dataIndex : 'id',
hidden : true
},{
header : '',
dataIndex : 'soaType',
width : 120,
},{
header : '',
dataIndex : 'soaName',
width : 120,
},{
header : '',
dataIndex : 'interfaceSourceId',
width : 120,
},{
header : '',
dataIndex : 'interfaceFromSourceId',
width : 120,
},{
header : '',
dataIndex : 'hastrasfer',
width : 120,
},{
header : '',
dataIndex : 'requestId',
width : 120,
},{
header : '',
dataIndex : 'responseId',
width : 120,
},{
header : '',
dataIndex : 'bussinessId',
width : 120,
},{
header : '',
dataIndex : 'submitDate',
width : 120,
},{
header : '',
dataIndex : 'dealDate',
width : 120,
},{
header : '项目编号',
dataIndex : 'entXmbh',
width : 120,
},{
header : '设计概算批复单位',
dataIndex : 'entCbsjgspfdw',
width : 120,
},{
header : '设计概算审批文号',


dataIndex : 'entCbsjgsspwh',
width : 120,
},{
header : '',
dataIndex : 'entLxny',
width : 120,
},{
header : '',
dataIndex : 'entJsdd',
width : 120,
},{
header : '',
dataIndex : 'entJsxz',
width : 120,
},{
header : '',
dataIndex : 'entJsgm',
width : 120,
},{
header : '',
dataIndex : 'entLxwh',
width : 120,
},{
header : '',
dataIndex : 'entHyzgzzjgdm',
width : 120,
},{
header : '',
dataIndex : 'entHyzgmc',
width : 120,
},{
header : '',
dataIndex : 'entXmyzzzjgdm',
width : 120,
},{
header : '',
dataIndex : 'entXmyzmc',
width : 120,
},{
header : '',
dataIndex : 'entTzgm',
width : 120,
},{
header : '',
dataIndex : 'entJszq',
width : 60,
},{
header : '',
dataIndex : 'entZjly',
width : 60,
},{
header : '',
dataIndex : 'entXmgk',
width : 60,
},{
header : '',
dataIndex : 'entXmsjdw',
width : 60,
},{
header : '',
dataIndex : 'entXmcjdw',
width : 60,
},{
header : '',
dataIndex : 'entXmjldw',
width : 120,
},{
header : '',
dataIndex : 'entSjzj',
width : 120,
},{
header : '',
dataIndex : 'entXmjl',
width : 120,
},{
header : '',
dataIndex : 'entJlzj',
width : 120,
},{
header : '',
dataIndex : 'entBz',
width : 120,
},{
header : '',
dataIndex : 'entXxtjdwzjjgdm',
width : 120,
},{
header : '',
dataIndex : 'entXxtjdw_name',
width : 120,
},{
header : '',
dataIndex : 'entSjzt',
width : 120,
},{
header : '',
dataIndex : 'entJlcssj',
width : 120,
}
,{
header : '',
dataIndex : 'attributy1',
width : 120,
}
,{
header : '',
dataIndex : 'attributy2',
width : 120,
}
,{
header : '',
dataIndex : 'attributy3',
width : 120,
}
,{
header : '',
dataIndex : 'attributy4',
width : 120,
}],
defaults : {
sortable : true,
menuDisabled : true,
width : 100
}
});

this.gridPanel = new Ext.grid.GridPanel({
id : 'AppUserGrid',
tbar : this.toolbar,
store : store,
region:'center',
shim : true,
trackMouseOver : true,
disableSelection : false,
loadMask : true,

cm : cm,
sm : sm,
viewConfig : {
forceFit : true,
enableRowBody : false,
showPreview : false
},
bbar : new HT.PagingBar({store : store,exportable: true})
});





};//end of the init GridPanel

我不知道在那个地方加滚动条才能显示呀!就高手讲解呀!谢谢!



[解决办法]
是不是应该配置viewConfig的 autoScroll:true属性,好久没用了,也记不清楚了!实在不行就允许列可以拖动改变大小,可以隐藏得了,简单又方便.
[解决办法]
viewConfig : {
forceFit : true,
enableRowBody : false,
showPreview : false
},
把这个里面的true改为false,或者直接把这个属性去掉,默认是false。
有些字段的属性你可以暂时设为hidden啊,要看的时候再让其显示嘛,干嘛一下要全部显示

热点排行