2013-08-02 65 views
0

我希望能夠編輯網格列,因爲它在AppSDK文檔中的簡單網格示例中顯示 https://developer.help.rallydev.com/apps/2.0rc1/doc/#!/example/Grid 但它看起來像是此功能不可用如果在使用自定義存儲默認:如何使用自定義商店時編輯網格列

_createGrid: function(stories) { 
    this.add({ 
     xtype: 'rallygrid', 
     store: Ext.create('Rally.data.custom.Store', { 
      data: stories, 
      pageSize: 100 
     }), 
     columnCfgs: [ 
      { 
       text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn', 
       tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate') 
      }, 
      { 
       text: 'Name', dataIndex: 'Name' 
      }, 
      //other columns... 
     ] 
    }); 
} 

在我的應用程序,當我點擊名稱,因爲它是在簡單的網格例子領域不會成爲編輯。

回答

0

可以修改代碼以添加內聯編輯功能: 將名稱列設置爲'textfield',將網格的selType設置爲'cellmodel',並實例化CellEditing插件。

_createGrid: function(stories) { 
     this.add({ 
      xtype: 'rallygrid', 
      store: Ext.create('Rally.data.custom.Store', { 
       data: stories, 
       pageSize: 100 
      }), 
      columnCfgs: [ 
       { 
        text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn', 
        tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate') 
       }, 
       { 
        text: 'Name', dataIndex: 'Name', editor: 'textfield' 
       } 
     //other columns... 
      ], 
      selType: 'cellmodel', 
      plugins: [ 
       Ext.create('Ext.grid.plugin.CellEditing', { 
       clicksToEdit: 1 
       }) 
      ] 

     }); 
    } 

請參閱Ext.grid.plugin.CellEditing here

文檔
相關問題