Railre 2012-08-03 11:00
浏览 792
已采纳

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})
            });

上面代码是显示数据库数据,由于数据字段太多,导致很多字段都无法显示,是不是要添加个滚动条才能完全显示,但是自己对EXT不太了解,希望懂的能帮助下! 谢谢
[img]http://dl.iteye.com/upload/attachment/0071/7364/d31ae0e7-f1b8-3e4d-9fc4-1db0cb795e69.png[/img]

};//end of the init GridPanel

  • 写回答

1条回答 默认 最新

  • iteye_7115 2012-08-03 15:08
    关注

    应该是你GridPanel的定义问题:
    viewConfig : {
    [color=red]forceFit : true, [/color]
    enableRowBody : false,
    showPreview : false
    }

    把foreFit:true去掉

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算