2014-11-14 63 views

回答

0

http://docs-origin.sencha.com/extjs/4.2.2/#!/api/Ext.grid.feature.Grouping-cfg-collapsible

可摺疊:布爾

設置爲false以禁用從UI坍塌組。當關聯的商店被緩衝時,它被設置爲false。

默認爲:真

使用features: [{ftype:'grouping', collapsible: false}],您的網格

Ext.application({ 
 
    name: 'Fiddle', 
 

 
    launch: function() { 
 
     var store = Ext.create('Ext.data.Store', { 
 
      storeId: 'employeeStore', 
 
      fields: ['name', 'seniority', 'department'], 
 
      groupField: 'department', 
 
      data: { 
 
       'employees': [{ 
 
        "name": "Michael Scott", 
 
        "seniority": 7, 
 
        "department": "Management" 
 
       }, { 
 
        "name": "Dwight Schrute", 
 
        "seniority": 2, 
 
        "department": "Sales" 
 
       }, { 
 
        "name": "Jim Halpert", 
 
        "seniority": 3, 
 
        "department": "Sales" 
 
       }, { 
 
        "name": "Kevin Malone", 
 
        "seniority": 4, 
 
        "department": "Accounting" 
 
       }, { 
 
        "name": "Angela Martin", 
 
        "seniority": 5, 
 
        "department": "Accounting" 
 
       }] 
 
      }, 
 
      proxy: { 
 
       type: 'memory', 
 
       reader: { 
 
        type: 'json', 
 
        root: 'employees' 
 
       } 
 
      } 
 
     }); 
 

 
     Ext.create('Ext.grid.Panel', { 
 
      title: 'Employees', 
 
      store: Ext.data.StoreManager.lookup('employeeStore'), 
 
      columns: [{ 
 
       text: 'Name', 
 
       dataIndex: 'name', 
 
       flex: 1 
 
      }, { 
 
       text: 'Seniority', 
 
       dataIndex: 'seniority', 
 
       flex: 1 
 
      }], 
 
      features: [{ 
 
       ftype: 'grouping', 
 
       collapsible: false 
 
      }], 
 
      width: 500, 
 
      renderTo: Ext.getBody() 
 
     }); 
 
    } 
 
});
<script src="https://extjs.cachefly.net/ext/gpl/4.2.1/ext-all-debug.js"></script> 
 
<link href="https://extjs.cachefly.net/ext/gpl/4.2.1/packages/ext-theme-classic/build/resources/ext-theme-classic-all.css" rel="stylesheet"/>

+0

感謝快速回復。作品 – jprism 2014-11-14 20:52:35