0

我正在尝试在一个看起来不错的视口中放置一个网格,但是一旦我获得的记录多于页面可以显示的部分,一些记录就不再可见,并且没有滚动条显示,但是水平条按预期显示?

我已经在 IE、Firefox 和 Chrome 中对此进行了测试,并且我得到了相同的行为,所以我相信我错过了某种设置。

    var grid4 = Ext.create('Ext.grid.Panel', {
    title: 'My Title',
    id:'button-grid',
    store: getLocalStore(),
    layout:'fit',
    columns: [
        { text : 'A', width: 50,dataIndex: 'a', sortable: true},
        { text : 'B',flex: 1, dataIndex: 'b', sortable: true},
        { text : 'C Name',width: 120, dataIndex: 'c', sortable: true},
        { text : 'D',width: 100, dataIndex: 'd', sortable: true},
        { text : 'E',width: 50, dataIndex: 'e', sortable: true},
        { text : 'F',width: 70, dataIndex: 'f', sortable: true},
        { text : 'G info',width: 60, dataIndex: 'g', sortable: true},
        { text : 'H Address',flex: 1, dataIndex: 'h', sortable: true},
        { text : 'I',width: 80, dataIndex: 'i', sortable: true},
        { text : 'J by',width: 80, dataIndex: 'j', sortable: true},
        { text : 'K Date',width: 90, dataIndex: 'k', sortable: true}
    ],
    columnLines: true,
    selModel: selModel,
    iconCls: 'icon-grid',
    // inline buttons
    dockedItems: [{
        xtype: 'toolbar',
        dock: 'bottom',
        ui: 'footer',
        layout: {
            pack: 'center'
        },
        items: [{
            minWidth: 80,
            text: 'remove'
        },{
            minWidth: 80,
            text: 'Disable'
        }]
    }, {
        xtype: 'toolbar',
        items: [{
            text:'Click here',
            tooltip:'Add a new row',
            iconCls:'add',
            handler : function(){
                win.show();
            }
        }]
    }]
});



// viewport
Ext.onReady(function(){
Ext.QuickTips.init();

var application = new Ext.Viewport({
    renderTo: document.body,
    layout:'fit',
    items: [{
        region: 'center',
        frame: true,
        border: false,
        items: grid4
    }]
});    

谢谢

4

2 回答 2

1

您正在过度嵌套网格,或者:

a) 使网格成为视口的第一个子项。b) 添加适合视口的第一个子项的布局。

a 是更好的选择。

于 2011-05-10T11:15:41.590 回答
0

设置autoScroll网格面板的属性:

autoScroll: true

默认情况下,此属性的值为 false。启用此属性会在组件布局元素上添加溢出:'auto',并在必要时自动显示滚动条。

于 2011-05-10T09:19:51.627 回答