Rally Grid中的重复数据

时间:2015-09-23 15:41:21

标签: rally

在运行此脚本以查看所有用户故事和缺陷的组合列表时,我在网格中出现了2组数据(重复)。当我点击过滤器并关闭并打开缺陷时,它会自行解决。有重复数据的任何想法以及如何解决它?

<!DOCTYPE html>
<html>
<head>
    <title>WorkItemList</title>

    <script type="text/javascript" src="/apps/2.0/sdk.js"></script>

    <script type="text/javascript">
        Rally.onReady(function () {
                Ext.define('CustomApp', {
  extend: 'Rally.app.App',
  componentCls: 'app',

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

  _onStoreBuilt: function(store) {
      var modelNames = ['userstory', 'defect'];
      var context = this.getContext();
      this.add({
          xtype: 'rallygridboard',
          modelNames: modelNames,
          context: context,
          enableHierarchy: 'true',
          toggleState: 'grid',
          plugins: [
              'rallygridboardaddnew',
              {
                  ptype: 'rallygridboardcustomfiltercontrol',
                  filterControlConfig: {
                      modelNames: modelNames
                  }
              },
              {
                  ptype: 'rallygridboardactionsmenu',
                  menuItems: [
                      {
                          text: 'Export...',
                          handler: function() {
                              window.location = Rally.ui.grid.GridCsvExport.buildCsvExportUrl(
                                  this.down('rallygridboard').getGridOrBoard());
                          },
                          scope: this
                      },
                      {
                          text: 'Print...',
                          handler: function () {
                              Ext.create('Rally.ui.grid.TreeGridPrintDialog', {
                                  grid: this.down('rallygridboard').getGridOrBoard(),
                                  treeGridPrinterConfig: {
                                      largeHeaderText: 'Tasks'
                                  }
                              });
                          },
                          scope: this
                      }
                  ],
                  buttonConfig: {
                      iconCls: 'icon-export'
                  }
              }
          ],
          cardBoardConfig: {
              attribute: 'ScheduleState'
          },
          gridConfig: {
              store: store,
              enableRanking: true,
              defaultSortToRank: true,
              enableBulkEdit: true,
              enableInlineAdd: true,
              showRowActionsColumn: true,
              columnCfgs: [
                'Rank',
                'FormattedID',
                'Name',
                'Release',
                'Iteration',
                'ScheduleState',
                'PlanEstimate',
                'TaskActualTotal',
                'Owner',
                'Tags'
              ]
          },
          height: this.getHeight()
      });
  }
});            


            Rally.launchApp('CustomApp', {
                name:"WorkItemList",
              parentRepos:""
            });

        });
    </script>


</head>
<body>
</body>
</html>

1 个答案:

答案 0 :(得分:1)

尝试从columnCfgs中省略Rank:

           columnCfgs: [
            'FormattedID',
            'Name',
            'Release',
            'Iteration',
            'ScheduleState',
            'PlanEstimate',
            'TaskActualTotal',
            'Owner',
            'Tags'
          ]
      }

rallygridboard默认包含Rank,我认为将其添加为列会让事情变得混乱。对上述代码片段的这种调整似乎就是我的伎俩。