0

我需要简单地在我的网格中添加一个函数,当用户第一次访问时隐藏行。之后,通过我的网格中已经出现的最小化/展开图标,用户可以展开组并查看行。我的代码是:

// create the grid
var grid = Ext.create('Ext.grid.Panel', {
    store: store,
    hideHeaders: true,
    features: [groupingFeature],

    columns: [
        {text: "Questions",groupable: false, flex: 1, dataIndex: 'species',  sortable: true}
    ],
    width: 250,
    height:260,
    split: true,
    region: 'west'
});

// define a template to use for the detail view

var bookTplMarkup = [
    '{resposta}<br/>'
];

var bookTp1 = Ext.create('Ext.Template', bookTplMarkup);
Ext.create('Ext.Panel', {
    renderTo: 'binding-example',
    frame: true,
    width: 720,
    height: 570,
    layout: 'border',
    items: [
        grid, {
            id: 'detailPanel',
            autoScroll: true,
            region: 'center',
            bodyPadding: 7,
            bodyStyle: "background: #ffffff;",
            html: 'Select one option'
    }]
});

我在哪里添加了 nedded 功能?

4

1 回答 1

0

我想 feature 的startCollapsed属性grouping就是你要找的:

{ ftype:'grouping', startCollapsed: true }
于 2013-03-13T20:36:02.317 回答