【问题标题】:How to fix table header in Extjs 4.2如何在 Extjs 4.2 中修复表头
【发布时间】:2014-02-25 12:08:45
【问题描述】:

我想在我的 ExtJs 4.2 应用程序中修复我的表格/网格标题,以便标题在滚动时始终可见。我的应用程序中的主网格有一个固定的标题,并按照本文底部的代码实现。 它不工作,我不知道为什么...... 我尝试使用 split 属性,但它也不起作用...... :(

这是代码:

function openThePopup() {
var win = new Ext.Window({
    modal : true,
    height : 500,
    width : 900,
    plain : true,
    border : false,
    resizable : false,
    maximizable : false,
    draggable : true,
    closable : true,
    closeAction : 'destroy',
    title : 'Title',
    autoScroll : true,
    buttonAlign : 'center',
    items : [ {
        xtype : 'grid',
        id : 'theGrid',
        store : theStore,
        border : 0,
        layout : 'fit',
        margins : '5 0 0 0',
        split : true,
        columns : [ {
            text : 'Country',
            dataIndex : 'country'
        }, {
            text : 'City',
            dataIndex : 'city'
        }, {
            text : 'ZIP',
            dataIndex : 'zip'
        }, {
            text : 'Street',
            dataIndex : 'street',
            width : 200
        }, {
            text : location,
            dataIndex : 'name',
            width : 200
        } ],
        listeners : {
            itemdblclick : function(t, record, item, index, e, eOpts) {
                ...
            }
        }
    } ],
    buttons : [ {
        onClick : function() {
            ...
        }
    } ]
}).show();
}

感谢任何帮助。

非常感谢您。

祝大家好运。

【问题讨论】:

    标签: header grid fixed extjs4.2


    【解决方案1】:

    您的布局配置不正确。 layout: 'fit' 应该出现在窗口上,并且布局配置应该从网格中删除。同时删除窗口上的autoScroll 配置。

    【讨论】:

    • 嗨,埃文,我需要自动滚动,但你的布局是正确的。现在它工作正常。非常感谢。
    • 自动滚动不在窗口上。根据定义,窗口不能滚动,因为它会将子网格的大小调整到它的大小。网格配置为自动滚动。所以,正如我上面所说,窗口上的autoScroll 什么都不做。
    • 再一次,你是完全正确的。它的工作原理和你说的完全一样。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多