2014-07-20 40 views
1

当某个字段在Rally中“隐藏”时,它们将不会显示在任何SDK的UI组件中。例如,我无法创建rallygrid,其dataIndex为_ref,因为_ref是隐藏字段。我也有隐藏的自定义字段,但我真的需要使用它们来创建rallygrid中的列。在Rally SDK中,在UI组件中显示隐藏字段

我已经浏览了SDK的源代码并知道这些已从SDK的UI组件中删除,所以我想我正在寻找解决方法或解决此问题的方法。

我谈到这个问题here

回答

1

这可能包括在根据custom store网格_ref。我修改自定义数据网格example来填充每个记录的_ref值的参考柱:

enter image description here

Ext.define('CustomApp', { 
    extend: 'Rally.app.App', 
    componentCls: 'app', 
    items:{ html:'<a href="https://help.rallydev.com/apps/2.0rc3/doc/">App SDK 2.0rc3 Docs</a>'}, 
    launch: function() { 
     Ext.create('Rally.data.wsapi.Store', { 
      model: 'userstory', 
      autoLoad: true, 
      listeners:{ 
       load: this._onDataLoaded, 
       scope: this 
      }, 
      fetch: ['FormattedID', 'Name', '_ref'] 
     }) 
    }, 
    _onDataLoaded: function(store,data){ 
     var records = _.map(data, function(record){ 
      return Ext.apply({ 
       Ref: record.get('_ref') 
      }, record.getData()); 
     }); 
     this.add({ 
      xtype: 'rallygrid', 
      showPagingToolbar: false, 
      showRowActionsColumn: false, 
      editable: false, 
      store: Ext.create('Rally.data.custom.Store', { 
       data: records 
      }), 
      columnCfgs:[ 
       { 
        xtype: 'templatecolumn', 
        text: 'ID', 
        dataIndex: 'FormattedID', 
        width: 100, 
        tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate') 
       }, 
       { 
        text: 'Name', 
        dataIndex: 'Name' 
       }, 
       { 
        text: 'Reference', 
        dataIndex: 'Ref', 
        flex: 1 
       } 
      ] 
     }) 
    } 
}); 
+0

这种方法确实让我显示自定义字段列,谢谢 – spsteffl