Horizontally Scrollable Grid in ExtJS 3.3

天涯浪子 提交于 2019-12-13 18:45:07

问题


I'm new to ExtJS and am having hard time accommodating a large number of columns in a 600px wide Ext.grid.EditorGridPanel (see example below). Scrolling all grid columns together or something similar to the second grid shown in this example (Ext 4) would do it.

var grid = new Ext.grid.EditorGridPanel(
    this.getGridConfig('', ['a', 'b', 'c', '...', 'x', 'y', 'z'], [
        {
            dataIndex: 'a',
            header: 'A',
            editor: new Ext.form.TextField({width: 200, allowEmpty: false})
        },
        {
            dataIndex: 'b',
            header: 'B',
            editor: bCombo,
        } /* many more column definitions here... */],
        definitions,
        'disabled'
    )
);

I've tried to set autoScroll = true at several different levels without any luck. Is there a mechanism to handle tons of grid columns in ExtJS 3.3, similar to the one provided for handling tabs?


回答1:


I've solved this issue by wrapping the Ext.grid.EditorGridPanel with the panel below and adjusting its width to accommodate all columns nicely.

var gridPanel = new Ext.Panel({
    width: '100%',
    height: '100%',
    renderTo: Ext.getBody(),
    autoScroll: true
});


来源:https://stackoverflow.com/questions/15073110/horizontally-scrollable-grid-in-extjs-3-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!