2013-03-13 83 views
0

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

// 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函数?

回答

0

我猜的grouping特征startCollapsed属性是你找什么:

{ ftype:'grouping', startCollapsed: true } 
+0

谢谢CD,但我会问你在哪里我在代码中插入了该功能? – user2162864 2013-03-13 20:59:18

+0

好吧,我找到了这个地方!非常感谢你! – user2162864 2013-03-13 21:02:37