2013-03-13 81 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