Javascript 在rally树网格中使用组合项构建项目

Javascript 在rally树网格中使用组合项构建项目,javascript,rally,Javascript,Rally,我想建立项目团队明智的投资组合项目 项目-1 -特色-1 -特色-2 项目-2 -特色-1 -特色-2 我无法在rally tree builder中获得项目和功能,我尝试了以下方法: Rally.onReady(function() { Ext.define('Rally.example.SimpleTreeGrid', { extend: 'Rally.app.App', componentCls: 'app',

我想建立项目团队明智的投资组合项目

项目-1 -特色-1 -特色-2

项目-2 -特色-1 -特色-2

我无法在rally tree builder中获得项目和功能,我尝试了以下方法:

       Rally.onReady(function() {
        Ext.define('Rally.example.SimpleTreeGrid', {
            extend: 'Rally.app.App',
            componentCls: 'app',

            launch: function() {
                Ext.create('Rally.data.wsapi.TreeStoreBuilder').build({
                    models: ['PortfolioItem/Feature'],
                    autoLoad: true,
                    enableHierarchy: true
                }).then({
                    success: this._onStoreBuilt,
                    scope: this
                });
            },

            _onStoreBuilt: function(store) {
                this.add({
                    xtype: 'rallytreegrid',
                    store: store,
                    context: this.getContext(),
                    enableEditing: false,
                    enableBulkEdit: false,
                    shouldShowRowActionsColumn: false,
                    enableRanking: false,
                    childEls: ["title"],
                    columnCfgs: [
                        'Name',
                        'State',
                        'Owner'
                    ]
                });
            }
        });


        Rally.launchApp('Rally.example.SimpleTreeGrid', {
          name: 'Simple Tree Grid Example'
        });
    });

明白了。。!我以按网格分组作为参考,并构建了网格

 _createGrid: function ()
            {
                var filter = Ext.create('Rally.data.wsapi.Filter', { property: 'Release.Name', operator: '=', value: ReleaseBoxValue });
                if (!this.down('#storygrid'))
                {
                    this.grid = this.add({
                        xtype: 'rallygrid',
                        itemId: 'storygrid',
                        columnCfgs: [
                              {
                                  text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn',
                                  tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
                              },
                              {
                                  text: 'Name', dataIndex: 'Name'
                              },                                 

                              {
                                  text: 'Accepted', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {

                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(acceptedStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;
                                  }
                              },
                              {
                                  text: 'Completed', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {                                         
                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(completedPercentage, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;
                                  }
                              },
                              {
                                  text: 'Defined', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {

                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(definedStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;
                                  }
                              },
                              {
                                  text: 'Grooming', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {

                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(grommedStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;
                                  }
                              },
                              {
                                  text: 'In-Progress', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {
                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(inProgressStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;
                                  }
                              },
                              {
                                  text: 'Grand Total', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {
                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(totalStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;
                                  }
                              },
                              {
                                  text: 'Optum Accepted Stories', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {

                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(acceptedStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;
                                  }
                              },
                              {
                                  text: 'Stories yet to be accepted', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {

                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(completedPercentage, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;                                          

                                  }
                              }
                              ,
                              {
                                  text: 'Total Stories', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {

                                      var Release = value;


                                      var html = "";
                                      var userStoriesCount = 0;
                                      _.each(totalStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              userStoriesCount++;
                                          }
                                      }, this);

                                      html = '<span>' + userStoriesCount + '</span>';
                                      return html;
                                  }
                              }
                              ,
                              {
                                  text: 'Optum Accepted Stories (%)', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {
                                      var Release = value;


                                      var html = "";
                                      var accepetedCount = 0;
                                      _.each(acceptedStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              accepetedCount++;
                                          }
                                      }, this);


                                      var totalStoriesCount = 0;
                                      _.each(totalStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              totalStoriesCount++;
                                          }
                                      }, this);

                                      var decTotal = accepetedCount / totalStoriesCount;
                                      if (!isNaN(decTotal))
                                      {
                                          html = '<span>' + Math.round((decTotal) * 100) + '%</span>';
                                      }
                                      else
                                      {
                                          html = '<span>0%</span>';
                                      }

                                      return html;
                                  }
                              }
                              ,
                              {
                                  text: 'Stories yet to be accepted (%)', dataIndex: 'FormattedID',
                                  renderer: function (value)
                                  {
                                      var Release = value;


                                      var html = "";
                                      var completedCount = 0;
                                      _.each(completedPercentage, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              completedCount++;
                                          }
                                      }, this);


                                      var totalStoriesCount = 0;
                                      _.each(totalStories, function (record)
                                      {
                                          if (record.key == Release)
                                          {

                                              totalStoriesCount++;
                                          }
                                      }, this);
                                      var decTotal = completedCount / totalStoriesCount;
                                      if (!isNaN(decTotal))
                                      {
                                          html = '<span>' + Math.round((decTotal) * 100) + '%</span>';
                                      }
                                      else
                                      {
                                          html = '<span>0%</span>';
                                      }

                                      return html;
                                  }
                              }
                        ],
                        context: this.getContext(),
                        features: [{
                            ftype: 'groupingsummary',
                            groupHeaderTpl: '{name} ({rows.length})'
                        }
                        ],
                        filters: [filter],
                        storeConfig: {
                            model: 'portfolioitem/feature',
                            groupField: 'Name',
                            groupDir: 'ASC',                                
                            fetch: ['FormattedID', 'Name', 'Release', 'Project', 'UserStories', 'HierarchicalRequirement'],
                            filters: [filter],
                            getGroupString: function (record)
                            {

                                var owner = record.get('Project');
                                return (owner && owner._refObjectName) || 'No Name';
                            }
                        }
                    });
                }
                else
                {
                    var filter = Ext.create('Rally.data.wsapi.Filter', { property: 'Release.Name', operator: '=', value: ReleaseBoxValue });
                    var treeGrid = this.down('rallygrid'),
                     treeStore = treeGrid.getStore();

                    treeStore.clearFilter(true);
                    treeStore.filter(filter);
                }
            }
\u createGrid:函数()
{
var filter=Ext.create('Rally.data.wsapi.filter',{property:'Release.Name',operator:'=',value:ReleaseBoxValue});
如果(!this.down('#storygrid'))
{
this.grid=this.add({
xtype:“rallygrid”,
itemId:'故事网格',
专栏CFGS:[
{
text:'Formatted ID',dataIndex:'FormattedID',xtype:'templatecolumn',
tpl:Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
},
{
文本:“名称”,数据索引:“名称”
},                                 
{
文本:“已接受”,数据索引:“FormattedID”,
渲染器:函数(值)
{
var释放=价值;
var html=“”;
var userstoriescont=0;
_.每个(已接受的故事、功能(记录)
{
if(record.key==释放)
{
userStoriesCount++;
}
},这个);
html=''+userStoriesCount+'';
返回html;
}
},
{
文本:“已完成”,数据索引:“FormattedID”,
渲染器:函数(值)
{                                         
var释放=价值;
var html=“”;
var userstoriescont=0;
_.每个(完成百分比、功能(记录)
{
if(record.key==释放)
{
userStoriesCount++;
}
},这个);
html=''+userStoriesCount+'';
返回html;
}
},
{
文本:“已定义”,数据索引:“FormattedID”,
渲染器:函数(值)
{
var释放=价值;
var html=“”;
var userstoriescont=0;
_.每个(定义的故事、功能(记录)
{
if(record.key==释放)
{
userStoriesCount++;
}
},这个);
html=''+userStoriesCount+'';
返回html;
}
},
{
文本:“整理”,数据索引:“FormattedID”,
渲染器:函数(值)
{
var释放=价值;
var html=“”;
var userstoriescont=0;
_.每个(故事、功能(记录)
{
if(record.key==释放)
{
userStoriesCount++;
}
},这个);
html=''+userStoriesCount+'';
返回html;
}
},
{
文本:“正在进行”,数据索引:“FormattedID”,
渲染器:函数(值)
{
var释放=价值;
var html=“”;
var userstoriescont=0;
_.each(程序故事、函数(记录)
{
if(record.key==释放)
{
userStoriesCount++;
}
},这个);
html=''+用户